FIFE  2008.0
FIFE::Object Class Reference

#include <object.h>

Inheritance diagram for FIFE::Object:
Collaboration diagram for FIFE::Object:

List of all members.

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
ObjectgetInherited () 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

Detailed Description

Object class

Objects describe the properties of objects. Objects may inherit default values from another object.

Definition at line 51 of file object.h.


Constructor & Destructor Documentation

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

See also:
Model in model/model.h for creation of objects.

Definition at line 37 of file object.cpp.

FIFE::Object::~Object ( )

Destructor

Definition at line 49 of file object.cpp.


Member Function Documentation

void FIFE::Object::adoptVisual ( AbstractVisual *  visual) [inline]

Sets visualization to be used. Transfers ownership.

Definition at line 113 of file object.h.

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

Parameters:
is_defaultif 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 61 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 84 of file object.cpp.

References getAction().

Referenced by createAction(), and getAction().

Here is the caller graph for this function:

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 98 of file object.cpp.

Action* FIFE::Object::getDefaultAction ( ) const [inline]

Gets default action assigned to this object. If none available, returns NULL

Definition at line 96 of file object.h.

Object* FIFE::Object::getInherited ( ) const [inline]

Gets an object where this object was inherited from

See also:
inherited object

Definition at line 109 of file object.h.

AbstractPather* FIFE::Object::getPather ( ) const [inline]

Gets associated pather

Definition at line 104 of file object.h.

template<typename T >
T* FIFE::Object::getVisual ( ) const [inline]

Gets used visualization

Definition at line 117 of file object.h.

Referenced by FIFE::ObjectVisual::create().

Here is the caller graph for this function:

bool FIFE::Object::isBlocking ( ) const

Gets if object blocks movement

Definition at line 114 of file object.cpp.

References isBlocking().

Referenced by isBlocking().

Here is the caller graph for this function:

bool FIFE::Object::isStatic ( ) const

Gets if object moves

Definition at line 124 of file object.cpp.

References isStatic().

Referenced by isStatic().

Here is the caller graph for this function:

void FIFE::Object::setBlocking ( bool  blocking) [inline]

Sets if object blocks movement

Definition at line 121 of file object.h.

void FIFE::Object::setId ( const std::string &  id) [inline]

Sets the identifier for this object.

Definition at line 73 of file object.h.

void FIFE::Object::setPather ( AbstractPather *  pather)

Sets pather used by instances created out of this object

Definition at line 110 of file object.cpp.

void FIFE::Object::setStatic ( bool  stat) [inline]

Set to true, if object is such that it doesn't move

Definition at line 129 of file object.h.


The documentation for this class was generated from the following files: