Public Member Functions | |
void | addArea (Area *area) |
void | addObject (StaticObject *staticObject, Point position) |
void | depthSort () |
void | draw () const |
Area * | getArea (int num) const |
int | getHeight () const |
int | getNumberOfAreas () const |
int | getNumberOfObjects () const |
StaticObject * | getObject (const char *name) const |
StaticObject * | getObject (int num) const |
int | getOpacity () const |
Tile * | getTile (int x, int y) |
TileSet * | getTileSet () const |
int | getWidth () const |
int | getZ () const |
bool | hasTiles () const |
Layer (TileSet *tileSet, int width, int height, int opacity, int z) | |
Layer () | |
void | makeEmpty () |
void | removeObject (StaticObject *staticObject) |
void | setOpacity (int opacity=255) |
void | setTiles (Tile **tiles=0) |
void | setTileSet (TileSet *tileSet) |
void | setZ (int z) |
void | update () |
~Layer () | |
Private Attributes | |
std::vector< Area * > | areas |
std::vector< Entity * > | entities |
int | height |
int | opacity |
std::vector< StaticObject * > | staticObjects |
Tile ** | tiles |
TileSet * | tileSet |
int | width |
int | z |
Annchienta::Layer::Layer | ( | ) |
Annchienta::Layer::Layer | ( | TileSet * | tileSet, | |
int | width, | |||
int | height, | |||
int | opacity, | |||
int | z | |||
) |
Annchienta::Layer::~Layer | ( | ) |
void Annchienta::Layer::addArea | ( | Area * | area | ) |
void Annchienta::Layer::addObject | ( | StaticObject * | staticObject, | |
Point | position | |||
) |
Adds an StaticObject to this Layer.
staticObject | StaticObject to be added. | |
position | Where this StaticObject should be placed. |
void Annchienta::Layer::depthSort | ( | ) |
Sorts all objects in this Layer based on their depth into the screen, so they will be drawn in the correct order.
void Annchienta::Layer::draw | ( | ) | const |
Draws this Layer to the screen.
Area* Annchienta::Layer::getArea | ( | int | num | ) | const |
int Annchienta::Layer::getHeight | ( | ) | const |
int Annchienta::Layer::getNumberOfAreas | ( | ) | const |
int Annchienta::Layer::getNumberOfObjects | ( | ) | const |
StaticObject* Annchienta::Layer::getObject | ( | const char * | name | ) | const |
Get an object from this Layer by name.
name | Name of the object. |
StaticObject* Annchienta::Layer::getObject | ( | int | num | ) | const |
Get an object from this Layer.
num | Id of the object. |
int Annchienta::Layer::getOpacity | ( | ) | const |
Tile* Annchienta::Layer::getTile | ( | int | x, | |
int | y | |||
) |
TileSet* Annchienta::Layer::getTileSet | ( | ) | const |
int Annchienta::Layer::getWidth | ( | ) | const |
int Annchienta::Layer::getZ | ( | ) | const |
bool Annchienta::Layer::hasTiles | ( | ) | const |
void Annchienta::Layer::makeEmpty | ( | ) |
Makes this Layer empty: removes all Tiles, objects, etc.
void Annchienta::Layer::removeObject | ( | StaticObject * | staticObject | ) |
Remove an object from this Layer.
staticObject | The object to remove. |
void Annchienta::Layer::setOpacity | ( | int | opacity = 255 |
) |
void Annchienta::Layer::setTiles | ( | Tile ** | tiles = 0 |
) |
void Annchienta::Layer::setTileSet | ( | TileSet * | tileSet | ) |
void Annchienta::Layer::setZ | ( | int | z | ) |
Sets the Z offset for this Layer.
z | The new Z offset. |
void Annchienta::Layer::update | ( | ) |
Updates this layer and everything in it: Tiles, Entities...
std::vector<Area*> Annchienta::Layer::areas [private] |
std::vector<Entity*> Annchienta::Layer::entities [private] |
int Annchienta::Layer::height [private] |
int Annchienta::Layer::opacity [private] |
std::vector<StaticObject*> Annchienta::Layer::staticObjects [private] |
Tile** Annchienta::Layer::tiles [private] |
TileSet* Annchienta::Layer::tileSet [private] |
int Annchienta::Layer::width [private] |
int Annchienta::Layer::z [private] |