5
* Created by Trenton Schulz on 3/24/05.
6
* Copyright 2005 Trolltech AS. All rights reserved.
10
#ifndef OUBLIETTELEVEL_H
11
#define OUBLIETTELEVEL_H
13
#include <QtCore/QtCore>
21
SmallHorizontalCorridor,
23
SmallVerticalCorridor,
30
OublietteLevel(int width = 128, int height = 96, int totalFeatures = 200);
32
inline QSize size() const { return m_size; }
33
inline int width() const { return size().width(); }
34
inline int height() const { return size().height(); }
35
inline int totalItems() const { return m_totalItems; }
36
Tile tile(int x, int y) const;
37
inline Tile tile(const QPoint &pos) const { return tile(pos.x(), pos.y()); }
38
void updateTileFlags(int x, int y, Tile::TileFlags flags);
39
inline void updateTileFlags(const QPoint &point, Tile::TileFlags flags)
40
{ updateTileFlags(point.x(), point.y(), flags); }
42
void addItemToTile(int x, int y, const Item *item);
43
inline void addItemToTile(const QPoint &pos, const Item *item)
44
{ addItemToTile(pos.x(), pos.y(), item); }
46
void clearTileFlags(int x, int y);
47
inline void clearTileFlags(const QPoint &point) { clearTileFlags(point.x(), point.y()); }
48
void printOubliette() const;
49
bool blockLOS(int x, int y);
50
void setTile(int x, int y, Tile element);
51
inline void setTile(const QPoint &pos, Tile element)
52
{ setTile(pos.x(), pos.y(), element); }
55
void generateOubliette();
56
void dig(LevelFeature feature, const QRect &rect);
57
void digRoom(const QRect &rect, Tile::TileFlags flags = Tile::Default);
58
QPoint findWall() const;
59
LevelFeature pickFeature() const;
60
QRect boundingRect(LevelFeature feature) const;
61
bool placeFeature(LevelFeature feature, const QPoint &pt);
62
inline void fillRect(const QRect &r, Tile le)
63
{ fillRect(r.x(), r.y(), r.width(), r.height(), le); }
64
void fillRect(int x, int y, int width, int height, Tile le);
65
bool checkForFeatures(const QRect &rect) const;
72
QList<QRect> m_roomList;
78
OubliettePlan(int totalLevels = 1);
80
OublietteLevel *level(int level) const;
81
inline int totalLevels() const { return m_totalLevels; }
84
QVector<OublietteLevel*> m_levels;
88
#endif // OUBLIETTELEVEL_H