Annchienta::Layer Class Reference

List of all members.

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


Constructor & Destructor Documentation

Annchienta::Layer::Layer (  ) 

Annchienta::Layer::Layer ( TileSet *  tileSet,
int  width,
int  height,
int  opacity,
int  z 
)

Annchienta::Layer::~Layer (  ) 


Member Function Documentation

void Annchienta::Layer::addArea ( Area *  area  ) 

Adds an Area to this Layer.

Parameters:
area Area to be added.

void Annchienta::Layer::addObject ( StaticObject *  staticObject,
Point  position 
)

Adds an StaticObject to this Layer.

Parameters:
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

Get an area from this Layer.

Parameters:
num Id of the Area you want.
Returns:
The requested Area, or 0 if it doesn't exist.

int Annchienta::Layer::getHeight (  )  const

Returns:
The height of this Layer.

int Annchienta::Layer::getNumberOfAreas (  )  const

Returns:
The number of Areas in this Layer.

int Annchienta::Layer::getNumberOfObjects (  )  const

Returns:
The number of objects in this Layer.

StaticObject* Annchienta::Layer::getObject ( const char *  name  )  const

Get an object from this Layer by name.

Parameters:
name Name of the object.
Returns:
The requested object, or 0 if it doesn't exist.

StaticObject* Annchienta::Layer::getObject ( int  num  )  const

Get an object from this Layer.

Parameters:
num Id of the object.
Returns:
The requested object, or 0 if it doesn't exist.

int Annchienta::Layer::getOpacity (  )  const

Returns:
The opacity of this Layer.

Tile* Annchienta::Layer::getTile ( int  x,
int  y 
)

Get a Tile from this Layer.

Parameters:
x X coord of the Tile.
y Y coord of the Tile.
Returns:
The Tile asked, or 0 if it doesn't exist.

TileSet* Annchienta::Layer::getTileSet (  )  const

Returns:
The TileSet used in this Layer.
Note:
It is probably a better idea to call Map::setTileSet().

int Annchienta::Layer::getWidth (  )  const

Returns:
The width of this Layer.

int Annchienta::Layer::getZ (  )  const

Returns:
The Z offset of this Layer.

bool Annchienta::Layer::hasTiles (  )  const

Returns:
If there are tiles in this Layer. (There should be, nothing to worry about.)

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.

Parameters:
staticObject The object to remove.

void Annchienta::Layer::setOpacity ( int  opacity = 255  ) 

Sets the opacity of the Layer. This currently does not work correct, and opacities lower than 255 will cause the Layer to be invisible.

Parameters:
opacity The new opacity for this Layer.

void Annchienta::Layer::setTiles ( Tile **  tiles = 0  ) 

Sets the tiles to be used for this Layer. This function is mainly internally used.

Parameters:
tiles 2D-array of Tile objects.
Warning:
This function might mess up the engine when not properly used.

void Annchienta::Layer::setTileSet ( TileSet *  tileSet  ) 

Associates a TileSet with this Layer.

Parameters:
tileSet TileSet to be used.
Note:
It is probably a better idea to call Map::setTileSet().

void Annchienta::Layer::setZ ( int  z  ) 

Sets the Z offset for this Layer.

Parameters:
z The new Z offset.

void Annchienta::Layer::update (  ) 

Updates this layer and everything in it: Tiles, Entities...


Member Data Documentation

std::vector<Area*> Annchienta::Layer::areas [private]

std::vector<Entity*> Annchienta::Layer::entities [private]

int Annchienta::Layer::width [private]

int Annchienta::Layer::z [private]


Generated on Wed Feb 4 16:31:47 2009 for Annchienta by  doxygen 1.5.7.1