#include <object.h>
Public Member Functions | |
Object (const std::string &identifier, const std::string &name_space, Object *inherited=NULL) | |
~Object () | |
void | setId (const std::string &id) |
Action * | createAction (const std::string &identifier, bool is_default=false) |
Action * | getAction (const std::string &identifier) const |
std::list< std::string > | getActionIds () const |
Action * | getDefaultAction () const |
void | setPather (AbstractPather *pather) |
AbstractPather * | getPather () const |
Object * | getInherited () const |
void | adoptVisual (AbstractVisual *visual) |
template<typename T > | |
T * | getVisual () const |
void | setBlocking (bool blocking) |
bool | isBlocking () const |
void | setStatic (bool stat) |
bool | isStatic () const |
Object class
Objects describe the properties of objects. Objects may inherit default values from another object.
Definition at line 51 of file object.h.
FIFE::Object::Object | ( | const std::string & | identifier, | |
const std::string & | name_space, | |||
Object * | inherited = NULL | |||
) |
Constructor An object may optionally inherit default attributes from another object. This object may override these defaults, but it may not CHANGE the inherited values.
Objects are created by calling Model::createObject, thus this method should really be called only by Model or test code
Definition at line 36 of file object.cpp.
FIFE::Object::~Object | ( | ) |
Destructor
Definition at line 48 of file object.cpp.
void FIFE::Object::adoptVisual | ( | AbstractVisual * | visual | ) | [inline] |
Action * FIFE::Object::createAction | ( | const std::string & | identifier, | |
bool | is_default = false | |||
) |
Adds new action with given id. In case there is action already with given id, returns it instead of new object Action instances are managed by object
is_default | if true, becomes default action for this object default objects are used e.g. when showing them on editor. if multiple default actions are created, last one remains. In case there's no explicit default action created, first action created becomes the default |
Definition at line 60 of file object.cpp.
References getAction().
Action * FIFE::Object::getAction | ( | const std::string & | identifier | ) | const |
Gets action with given id. If not found, returns NULL
Definition at line 83 of file object.cpp.
References getAction().
Referenced by createAction(), and getAction().
std::list< std::string > FIFE::Object::getActionIds | ( | ) | const |
Gets all available action ids of the object and packs them into a list
Definition at line 97 of file object.cpp.
Action* FIFE::Object::getDefaultAction | ( | ) | const [inline] |
Object* FIFE::Object::getInherited | ( | ) | const [inline] |
AbstractPather* FIFE::Object::getPather | ( | ) | const [inline] |
T* FIFE::Object::getVisual | ( | ) | const [inline] |
Gets used visualization
Definition at line 117 of file object.h.
Referenced by FIFE::ObjectVisual::create(), and FIFE::InstanceVisualCacheItem::getStaticImageIndexByAngle().
bool FIFE::Object::isBlocking | ( | ) | const |
Gets if object blocks movement
Definition at line 113 of file object.cpp.
References isBlocking().
Referenced by isBlocking().
bool FIFE::Object::isStatic | ( | ) | const |
Gets if object moves
Definition at line 123 of file object.cpp.
References isStatic().
Referenced by isStatic().
void FIFE::Object::setBlocking | ( | bool | blocking | ) | [inline] |
void FIFE::Object::setId | ( | const std::string & | id | ) | [inline] |
void FIFE::Object::setPather | ( | AbstractPather * | pather | ) |
Sets pather used by instances created out of this object
Definition at line 109 of file object.cpp.
void FIFE::Object::setStatic | ( | bool | stat | ) | [inline] |