Inherited by Annchienta::Person, and SwigDirector_StaticObject.
Public Member Functions | |
void | calculateCollidingTiles () |
virtual bool | canInteract () const |
bool | collidesWithOtherObjects () const |
virtual void | draw () |
virtual void | freeze (bool) |
const char * | getAnimation () const |
virtual int | getDepth () |
virtual EntityType | getEntityType () const |
virtual Mask * | getMask () const |
virtual Point | getMaskPosition () const |
virtual Point | getPosition () const |
Surface * | getSprite () const |
const char * | getXmlFile () const |
float | getZFromCollidingTiles () |
virtual bool | isPassable () const |
virtual void | lookAt (StaticObject *other) |
virtual void | onInteract () |
bool | setAnimation (const char *animationName) |
virtual void | setOnInteractCode (const char *code) |
virtual void | setOnInteractScript (const char *script) |
virtual void | setPassable (bool passable) |
virtual void | setPosition (Point position) |
virtual void | setSprite (const char *filename) |
virtual void | setStandAnimation (bool b=false) |
StaticObject (const char *name, Surface *surf, Mask *mask) | |
StaticObject (const char *name, const char *configfile) | |
virtual bool | stepTo (Point) |
virtual void | update () |
virtual | ~StaticObject () |
Protected Attributes | |
std::vector< Animation * > | animations |
std::list< Tile * > | collidingTiles |
int | currentAnimation |
int | currentFrame |
std::vector< Frame * > | frames |
Point | mapPosition |
Mask * | mask |
char * | onInteractCode |
char * | onInteractScript |
bool | passable |
Point | position |
int | speedTimer |
Surface * | sprite |
Tile * | tileStandingOn |
char | xmlFile [DEFAULT_STRING_SIZE] |
Annchienta::StaticObject::StaticObject | ( | const char * | name, | |
const char * | configfile | |||
) |
Create a new StaticObject.
name | Name for this StaticObject. | |
configfile | XML File where animations, sprite etc. should be loaded from. |
Create a new StaticObject without a config file. This is used to create simple objects which do not have animations.
name | Name for this StaticObject. | |
surf | Sprite for this StaticObject. | |
mask | Collision mask for this StaticObject. |
virtual Annchienta::StaticObject::~StaticObject | ( | ) | [virtual] |
void Annchienta::StaticObject::calculateCollidingTiles | ( | ) |
This function calculates which tiles the StaticObject is colliding with and stores them internally.
virtual bool Annchienta::StaticObject::canInteract | ( | ) | const [virtual] |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
bool Annchienta::StaticObject::collidesWithOtherObjects | ( | ) | const |
This function check if this StaticObject collides with other Objects in the same layer.
virtual void Annchienta::StaticObject::draw | ( | ) | [virtual] |
Draws this StaticObject to the screen.
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::freeze | ( | bool | ) | [virtual] |
Reimplemented in SwigDirector_StaticObject, SwigDirector_Person, and Annchienta::Person.
const char* Annchienta::StaticObject::getAnimation | ( | ) | const |
Get the name of the currently playing animation.
virtual int Annchienta::StaticObject::getDepth | ( | ) | [virtual] |
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual EntityType Annchienta::StaticObject::getEntityType | ( | ) | const [virtual] |
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, SwigDirector_Person, and Annchienta::Person.
virtual Mask* Annchienta::StaticObject::getMask | ( | ) | const [virtual] |
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual Point Annchienta::StaticObject::getMaskPosition | ( | ) | const [virtual] |
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual Point Annchienta::StaticObject::getPosition | ( | ) | const [virtual] |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
Surface* Annchienta::StaticObject::getSprite | ( | ) | const |
const char* Annchienta::StaticObject::getXmlFile | ( | ) | const |
float Annchienta::StaticObject::getZFromCollidingTiles | ( | ) |
This function calculates the current Z coordinate of this StaticObject and returns it.
virtual bool Annchienta::StaticObject::isPassable | ( | ) | const [virtual] |
If this object is passable, other objects can "walk through" it.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::lookAt | ( | StaticObject * | other | ) | [virtual] |
Reimplemented in SwigDirector_StaticObject, SwigDirector_Person, and Annchienta::Person.
virtual void Annchienta::StaticObject::onInteract | ( | ) | [virtual] |
When you call this function, this object's interact script and/or code will be executed if they exist.
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
bool Annchienta::StaticObject::setAnimation | ( | const char * | animationName | ) |
Set the animation for this StaticObject. Animations should be declared in it's XML file.
animationName | Name of the to be set animation. |
virtual void Annchienta::StaticObject::setOnInteractCode | ( | const char * | code | ) | [virtual] |
Sets this object's interact code. This code will be executed when the object is interacted with.
code | Code to be executed. |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::setOnInteractScript | ( | const char * | script | ) | [virtual] |
Sets this object's interact script. This script will be executed when the object is interacted with.
script | Filename of the script. |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::setPassable | ( | bool | passable | ) | [virtual] |
If this object is passable, other objects can "walk through" it.
passable | If this object should be passable. |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::setPosition | ( | Point | position | ) | [virtual] |
Sets the position for this StaticObject.
position | The new position. |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::setSprite | ( | const char * | filename | ) | [virtual] |
Should be used with care, because the frame settings stay the same.
filename | Filename of the new sprite. |
Reimplemented in SwigDirector_StaticObject, and SwigDirector_Person.
virtual void Annchienta::StaticObject::setStandAnimation | ( | bool | b = false |
) | [virtual] |
Reimplemented in SwigDirector_StaticObject, SwigDirector_Person, and Annchienta::Person.
virtual bool Annchienta::StaticObject::stepTo | ( | Point | ) | [virtual] |
Reimplemented in SwigDirector_StaticObject.
virtual void Annchienta::StaticObject::update | ( | ) | [virtual] |
Updates this Entity. This is called when updating the Map this Entity is in.
Implements Annchienta::Entity.
Reimplemented in SwigDirector_StaticObject, SwigDirector_Person, and Annchienta::Person.
std::vector<Animation*> Annchienta::StaticObject::animations [protected] |
std::list<Tile*> Annchienta::StaticObject::collidingTiles [protected] |
int Annchienta::StaticObject::currentAnimation [protected] |
int Annchienta::StaticObject::currentFrame [protected] |
std::vector<Frame*> Annchienta::StaticObject::frames [protected] |
Point Annchienta::StaticObject::mapPosition [protected] |
Mask* Annchienta::StaticObject::mask [protected] |
char * Annchienta::StaticObject::onInteractCode [protected] |
char* Annchienta::StaticObject::onInteractScript [protected] |
bool Annchienta::StaticObject::passable [protected] |
Point Annchienta::StaticObject::position [protected] |
int Annchienta::StaticObject::speedTimer [protected] |
Surface* Annchienta::StaticObject::sprite [protected] |
Tile* Annchienta::StaticObject::tileStandingOn [protected] |
char Annchienta::StaticObject::xmlFile[DEFAULT_STRING_SIZE] [protected] |