Annchienta::Tile Class Reference

Holds a Tile. More...

Inherits Annchienta::Entity.

Inherited by SwigDirector_Tile.

List of all members.

Public Member Functions

virtual void draw ()
virtual int getDepth ()
virtual EntityType getEntityType () const
virtual MaskgetMask () const
virtual Point getMaskPosition () const
ObstructionType getObstructionType () const
Point getPoint (int i) const
PointgetPointPointer (int i)
int getSideSurface () const
int getSideSurfaceOffset () const
int getSurface (int i) const
int getZ (int point) const
bool hasPoint (Point point)
bool hasVisualIndication () const
bool isNullTile () const
bool isShadowed () const
void setObstructionType (ObstructionType obstructionType)
 Sets the ObstructionType.
void setShadowed (bool shadowed)
void setSideSurface (int ss)
void setSideSurfaceOffset (int sso)
void setSurface (int index, int s)
void setVisualIndication (bool visualIndication)
void setZ (int point, int z)
 Tile (TileSet *, Point, int, Point, int, Point, int, Point, int, int ssOffset=0, int ss=0)
virtual void update ()
 ~Tile ()

Private Member Functions

void makeList ()

Private Attributes

Point isoPoints [4]
GLuint list
bool needsRecompiling
bool nullTile
ObstructionType obstruction
Point points [4]
bool shadowed
int sideSurfaceNumber
int sideSurfaceOffset
int surfaceNumbers [4]
Surfacesurfaces [4]
bool visualIndication

Detailed Description

Holds a Tile.

This class is used to hold parts of the Layer, called tiles. Because we are using an isometric system, tiles are usually shaped like a rhombus.

A Tile consist of four Points, indexed like this:


A Tile has a top Surface and a Side Surface.


Constructor & Destructor Documentation

Annchienta::Tile::Tile ( TileSet ,
Point  ,
int  ,
Point  ,
int  ,
Point  ,
int  ,
Point  ,
int  ,
int  ssOffset = 0,
int  ss = 0 

Annchienta::Tile::~Tile (  ) 

Member Function Documentation

virtual void Annchienta::Tile::draw (  )  [virtual]

Draws the entity to the screen.

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

virtual int Annchienta::Tile::getDepth (  )  [virtual]

Depth to be used for depthsorting.

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

virtual EntityType Annchienta::Tile::getEntityType (  )  const [virtual]

Get the type of this Entity.

The type of this entity.

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

virtual Mask* Annchienta::Tile::getMask (  )  const [virtual]

The collision mask for this entity.

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

virtual Point Annchienta::Tile::getMaskPosition (  )  const [virtual]

Where the tile mask should be placed... this is mostly used internally.

Not available in Python.

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

ObstructionType Annchienta::Tile::getObstructionType (  )  const

Point Annchienta::Tile::getPoint ( int  i  )  const

Returns a point in this tile with the given index.

Not available in Python.

Point* Annchienta::Tile::getPointPointer ( int  i  ) 

Gets a reference to a Point of this Tile. You can use this when you actually want to change a Tile's properties (like when you're creating an editor). This function returns a MapPoint (PointType).

int Annchienta::Tile::getSideSurface (  )  const

int Annchienta::Tile::getSideSurfaceOffset (  )  const

int Annchienta::Tile::getSurface ( int  i  )  const

int Annchienta::Tile::getZ ( int  point  )  const

Returns the Z coordinate of the Point with the index given by point.

bool Annchienta::Tile::hasPoint ( Point  point  ) 

Checks if the given point lies within this Tile.

bool Annchienta::Tile::hasVisualIndication (  )  const

bool Annchienta::Tile::isNullTile (  )  const

A NullTile is a Tile that will not be drawn at all because it is entirely transparent. A Person will not be able to walk over this Tile either. A tile marked as a NullTile when one or more of it's points have a null surface.

bool Annchienta::Tile::isShadowed (  )  const

void Annchienta::Tile::makeList (  )  [private]

void Annchienta::Tile::setObstructionType ( ObstructionType  obstructionType  ) 

Sets the ObstructionType.

There are three possibilities:

  • DefaultObstruction
The default value. Persons will be able to step on this Tile, depending on the height and the values set by MapManager.setMaxAscentHeight() and MapManager.setMaxDescentHeight().

  • NoObstruction
All Persons will always be able to step on this Tile, regardless of it's height.

  • FullObstruction
Nobody will ever be able to step on this Tile, regardless of it's height.

obstructionType The new ObstructionType for this tile.

void Annchienta::Tile::setShadowed ( bool  shadowed  ) 

void Annchienta::Tile::setSideSurface ( int  ss  ) 

void Annchienta::Tile::setSideSurfaceOffset ( int  sso  ) 

void Annchienta::Tile::setSurface ( int  index,
int  s 

Sets the top Surface of this Tile. When you want to construct a Tile from only one Surface, call this for all four indexes.

The s stands for the number of the Surface, as defined by the TileSet being used in this Map.

void Annchienta::Tile::setVisualIndication ( bool  visualIndication  ) 

void Annchienta::Tile::setZ ( int  point,
int  z 

Sets the Z value of a point.

point Index of the point you want to set the Z for.
z The new Z coordinate for this Point.

virtual void Annchienta::Tile::update (  )  [virtual]

Updates the entity, eg. update sprite, position, ...

Implements Annchienta::Entity.

Reimplemented in SwigDirector_Tile.

Member Data Documentation

GLuint Annchienta::Tile::list [private]

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