FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <object.h>
Classes | |
class | BasicObjectProperty |
class | MovableObjectProperty |
class | MultiObjectProperty |
Public Member Functions | |
Object (const std::string &identifier, const std::string &name_space, Object *inherited=NULL) | |
Constructor An object may optionally inherit default attributes from another object. More... | |
~Object () | |
Destructor. More... | |
const std::string & | getId () const |
const std::string & | getNamespace () const |
void | setId (const std::string &id) |
Sets the identifier for this object. More... | |
Action * | createAction (const std::string &identifier, bool is_default=false) |
Adds new action with given id. More... | |
Action * | getAction (const std::string &identifier, bool deepsearch=true) const |
Gets action with given id. More... | |
std::list< std::string > | getActionIds () const |
Gets all available action ids of the object and packs them into a list. More... | |
void | setDefaultAction (const std::string &identifier) |
Sets default action assigned to this object. More... | |
Action * | getDefaultAction () const |
Gets default action assigned to this object. More... | |
void | setPather (IPather *pather) |
Sets pather used by instances created out of this object. More... | |
IPather * | getPather () const |
Gets associated pather. More... | |
Object * | getInherited () const |
Gets an object where this object was inherited from. More... | |
void | adoptVisual (IVisual *visual) |
Sets visualization to be used. More... | |
template<typename T > | |
T * | getVisual () const |
Gets used visualization. More... | |
void | setBlocking (bool blocking) |
Sets if object blocks movement. More... | |
bool | isBlocking () const |
Gets if object blocks movement. More... | |
void | setStatic (bool stat) |
Set to true, if object is such that it doesn't move. More... | |
bool | isStatic () const |
Gets if object moves. More... | |
void | setFilename (const std::string &file) |
const std::string & | getFilename () const |
void | setCellStackPosition (uint8_t position) |
Sets the cell stack position. More... | |
uint8_t | getCellStackPosition () const |
Returns cell stack position. More... | |
bool | isSpecialCost () const |
Gets if object uses special cost. More... | |
void | setCostId (const std::string &cost) |
Sets the cost id. More... | |
std::string | getCostId () const |
Returns the cost id. More... | |
void | setCost (double cost) |
Sets the cost. More... | |
double | getCost () const |
Returns the cost. More... | |
bool | isSpecialSpeed () const |
Gets if object uses special speed modifier. More... | |
void | setSpeed (double cost) |
Sets the speed modifier. More... | |
double | getSpeed () const |
Returns the speed modifier. More... | |
bool | isMultiObject () const |
Gets if object uses special cost. More... | |
void | addMultiPartId (const std::string &partId) |
Adds a multi part identifier. More... | |
std::list< std::string > | getMultiPartIds () const |
Returns all multi part identifiers. More... | |
void | removeMultiPartId (const std::string &partId) |
Removes a multi part identifier. More... | |
void | removeAllMultiPartIds () |
Removes all multi part identifiers. More... | |
bool | isMultiPart () const |
Gets if object is a part of a multi object. More... | |
void | setMultiPart (bool part) |
Sets the object as a part of a multi object. More... | |
void | addMultiPart (Object *obj) |
Adds a object as a part of a multi object. More... | |
std::set< Object * > | getMultiParts () const |
Returns all multi part objects. More... | |
void | removeMultiPart (Object *obj) |
Removes a multi part object. More... | |
void | removeMultiParts () |
Removes all multi part objects. More... | |
void | addMultiPartCoordinate (int32_t rotation, ModelCoordinate coord) |
Adds rotationally dependent coordinates for this object part. More... | |
std::multimap< int32_t, ModelCoordinate > | getMultiPartCoordinates () const |
Returns all rotationally dependent coordinates from this object part. More... | |
std::vector< ModelCoordinate > | getMultiPartCoordinates (int32_t rotation) const |
Returns all object part coordinates for the given rotation. More... | |
std::vector< ModelCoordinate > | getMultiObjectCoordinates (int32_t rotation) const |
Returns all multi object coordinates for the given rotation. More... | |
void | setRotationAnchor (const ExactModelCoordinate &anchor) |
Sets the rotation anchor for this multi object. More... | |
ExactModelCoordinate | getRotationAnchor () const |
Returns the rotation anchor for this multi object. More... | |
void | setRestrictedRotation (bool restrict) |
Sets the rotation to restricted. More... | |
bool | isRestrictedRotation () const |
Gets if object uses restricted rotations. More... | |
int32_t | getRestrictedRotation (int32_t rotation) |
Returns the most obvious rotation, based on multi coordinates. More... | |
void | setZStepRange (int32_t zRange) |
Sets z-step range for object. More... | |
int32_t | getZStepRange () const |
Returns z-step range from object. More... | |
void | setArea (const std::string &id) |
Sets the area id that the instances of this object adds to their cells. More... | |
std::string | getArea () const |
Gets the area id that the instances of this object adds to their cells. More... | |
void | addWalkableArea (const std::string &id) |
Adds an area id to walkable area. More... | |
void | removeWalkableArea (const std::string &id) |
Removes an area id from walkable areas. More... | |
std::list< std::string > | getWalkableAreas () const |
Returns a list that contains all walkable area ids. More... | |
bool | operator== (const Object &obj) const |
Compares equality of two objects. More... | |
bool | operator!= (const Object &obj) const |
Compares unequality of two objects. More... | |
Private Attributes | |
std::string | m_id |
identifier More... | |
std::string | m_namespace |
namespace More... | |
std::string | m_filename |
filename More... | |
Object * | m_inherited |
pointer to inherited object More... | |
IVisual * | m_visual |
pointer to object visual More... | |
BasicObjectProperty * | m_basicProperty |
MovableObjectProperty * | m_moveProperty |
MultiObjectProperty * | m_multiProperty |
Object class.
Objects describe the properties of objects. Objects may inherit default values from another object.
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 74 of file object.cpp.
FIFE::Object::~Object | ( | ) |
Destructor.
Definition at line 85 of file object.cpp.
References m_basicProperty, m_moveProperty, m_multiProperty, and m_visual.
void FIFE::Object::addMultiPart | ( | Object * | obj | ) |
Adds a object as a part of a multi object.
obj | A pointer to the multi part object. |
Definition at line 410 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiParts, and m_multiProperty.
Referenced by getVisual().
void FIFE::Object::addMultiPartCoordinate | ( | int32_t | rotation, |
ModelCoordinate | coord | ||
) |
Adds rotationally dependent coordinates for this object part.
rotation | A integer value for the angle. |
coord | A ModelCoordinate as relative coordinate, 0,0 is always the multi object center. |
Definition at line 442 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiPartCoordinates, m_multiProperty, and FIFE::Object::MultiObjectProperty::m_partAngleMap.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::addMultiPartId | ( | const std::string & | partId | ) |
Adds a multi part identifier.
partId | A const reference to a string that holds the identifier. |
Definition at line 356 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiPartIds, and m_multiProperty.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::addWalkableArea | ( | const std::string & | id | ) |
Adds an area id to walkable area.
The instances of this object can only walk on cells that part of the given areas.
id | The area id. |
Definition at line 590 of file object.cpp.
References m_moveProperty, and FIFE::Object::MovableObjectProperty::m_walkableAreas.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::adoptVisual | ( | IVisual * | visual | ) |
Sets visualization to be used.
Transfers ownership.
Definition at line 209 of file object.cpp.
References m_visual.
Referenced by FIFE::Instance::createOwnObject(), and setId().
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
identifier | An identifier or name to give the action. |
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 92 of file object.cpp.
References getAction(), FIFE::Object::BasicObjectProperty::m_actions, m_basicProperty, and FIFE::Object::BasicObjectProperty::m_defaultAction.
Referenced by FIFE::Instance::getActionVisual(), FIFE::ObjectLoader::load(), and setId().
Action * FIFE::Object::getAction | ( | const std::string & | identifier, |
bool | deepsearch = true |
||
) | const |
Gets action with given id.
If not found, returns NULL
Definition at line 121 of file object.cpp.
References getAction(), FIFE::Object::BasicObjectProperty::m_actions, m_basicProperty, and m_inherited.
Referenced by createAction(), getAction(), FIFE::Instance::getActionVisual(), FIFE::Instance::initializeAction(), FIFE::MapLoader::load(), FIFE::Instance::move(), setDefaultAction(), and setId().
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 140 of file object.cpp.
References FIFE::Object::BasicObjectProperty::m_actions, and m_basicProperty.
Referenced by setId().
std::string FIFE::Object::getArea | ( | ) | const |
Gets the area id that the instances of this object adds to their cells.
Definition at line 580 of file object.cpp.
References getArea(), FIFE::Object::BasicObjectProperty::m_area, m_basicProperty, and m_inherited.
Referenced by FIFE::Cell::addInstance(), getArea(), getVisual(), and FIFE::Cell::removeInstance().
uint8_t FIFE::Object::getCellStackPosition | ( | ) | const |
Returns cell stack position.
Definition at line 265 of file object.cpp.
References getCellStackPosition(), m_basicProperty, FIFE::Object::BasicObjectProperty::m_cellStack, and m_inherited.
Referenced by getCellStackPosition(), getVisual(), and FIFE::MapSaver::save().
double FIFE::Object::getCost | ( | ) | const |
Returns the cost.
Definition at line 309 of file object.cpp.
References getCost(), FIFE::Object::MovableObjectProperty::m_cost, m_inherited, and m_moveProperty.
Referenced by getCost(), FIFE::Instance::getCost(), getVisual(), and FIFE::MapSaver::save().
std::string FIFE::Object::getCostId | ( | ) | const |
Returns the cost id.
Definition at line 292 of file object.cpp.
References getCostId(), FIFE::Object::MovableObjectProperty::m_costId, m_inherited, and m_moveProperty.
Referenced by getCostId(), FIFE::Instance::getCostId(), getVisual(), and FIFE::MapSaver::save().
Action * FIFE::Object::getDefaultAction | ( | ) | const |
Gets default action assigned to this object.
If none available, returns NULL
Definition at line 178 of file object.cpp.
References getDefaultAction(), m_basicProperty, FIFE::Object::BasicObjectProperty::m_defaultAction, and m_inherited.
Referenced by FIFE::Instance::getActionVisual(), getDefaultAction(), setId(), and FIFE::LayerCache::updateVisual().
const std::string & FIFE::Object::getFilename | ( | ) | const |
Definition at line 254 of file object.cpp.
References m_filename.
Referenced by getVisual().
|
inline |
Definition at line 68 of file object.h.
References m_id.
Referenced by FIFE::Instance::createOwnObject(), FIFE::Model::deleteObject(), operator!=(), operator==(), and FIFE::MapSaver::save().
Object * FIFE::Object::getInherited | ( | ) | const |
Gets an object where this object was inherited from.
Definition at line 205 of file object.cpp.
References m_inherited.
Referenced by setId().
std::vector< ModelCoordinate > FIFE::Object::getMultiObjectCoordinates | ( | int32_t | rotation | ) | const |
Returns all multi object coordinates for the given rotation.
rotation | A integer value for the angle. |
Definition at line 478 of file object.cpp.
References FIFE::getIndexByAngle(), getMultiObjectCoordinates(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiAngleMap, FIFE::Object::MultiObjectProperty::m_multiObjectCoordinates, FIFE::Object::MultiObjectProperty::m_multiParts, and m_multiProperty.
Referenced by FIFE::Instance::follow(), getMultiObjectCoordinates(), FIFE::Route::getOccupiedCells(), getVisual(), FIFE::Instance::move(), and FIFE::Instance::processMovement().
std::multimap< int32_t, ModelCoordinate > FIFE::Object::getMultiPartCoordinates | ( | ) | const |
Returns all rotationally dependent coordinates from this object part.
Definition at line 450 of file object.cpp.
References getMultiPartCoordinates(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiPartCoordinates, and m_multiProperty.
Referenced by getMultiPartCoordinates(), and getVisual().
std::vector< ModelCoordinate > FIFE::Object::getMultiPartCoordinates | ( | int32_t | rotation | ) | const |
Returns all object part coordinates for the given rotation.
rotation | A integer value for the angle. |
Definition at line 460 of file object.cpp.
References FIFE::getIndexByAngle(), getMultiPartCoordinates(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiPartCoordinates, m_multiProperty, and FIFE::Object::MultiObjectProperty::m_partAngleMap.
std::list< std::string > FIFE::Object::getMultiPartIds | ( | ) | const |
Returns all multi part identifiers.
Definition at line 363 of file object.cpp.
References getMultiPartIds(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiPartIds, and m_multiProperty.
Referenced by getMultiPartIds(), and getVisual().
std::set< Object * > FIFE::Object::getMultiParts | ( | ) | const |
Returns all multi part objects.
Definition at line 417 of file object.cpp.
References getMultiParts(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiParts, and m_multiProperty.
Referenced by getMultiParts(), and getVisual().
|
inline |
Definition at line 69 of file object.h.
References m_namespace.
Referenced by FIFE::Instance::createOwnObject(), FIFE::Model::deleteObject(), operator!=(), operator==(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::InstanceRenderer::renderUnsorted(), and FIFE::MapSaver::save().
IPather * FIFE::Object::getPather | ( | ) | const |
Gets associated pather.
Definition at line 195 of file object.cpp.
References getPather(), m_inherited, m_moveProperty, and FIFE::Object::MovableObjectProperty::m_pather.
Referenced by getPather(), FIFE::Instance::initializeAction(), and setId().
int32_t FIFE::Object::getRestrictedRotation | ( | int32_t | rotation | ) |
Returns the most obvious rotation, based on multi coordinates.
rotation | A integer value for the original angle. |
Definition at line 542 of file object.cpp.
References FIFE::getIndexByAngle(), getRestrictedRotation(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiAngleMap, m_multiProperty, and FIFE::Object::MultiObjectProperty::m_partAngleMap.
Referenced by getRestrictedRotation(), getVisual(), and FIFE::Instance::updateMultiInstances().
ExactModelCoordinate FIFE::Object::getRotationAnchor | ( | ) | const |
Returns the rotation anchor for this multi object.
Definition at line 515 of file object.cpp.
References getRotationAnchor(), m_inherited, m_multiProperty, and FIFE::Object::MultiObjectProperty::m_rotationAnchor.
Referenced by getRotationAnchor(), getVisual(), and FIFE::Instance::updateMultiInstances().
double FIFE::Object::getSpeed | ( | ) | const |
Returns the speed modifier.
Definition at line 336 of file object.cpp.
References getSpeed(), m_inherited, m_moveProperty, and FIFE::Object::MovableObjectProperty::m_speed.
Referenced by getSpeed(), FIFE::Instance::getSpeed(), and getVisual().
|
inline |
Gets used visualization.
Definition at line 122 of file object.h.
References addMultiPart(), addMultiPartCoordinate(), addMultiPartId(), addWalkableArea(), getArea(), getCellStackPosition(), getCost(), getCostId(), getFilename(), getMultiObjectCoordinates(), getMultiPartCoordinates(), getMultiPartIds(), getMultiParts(), getRestrictedRotation(), getRotationAnchor(), getSpeed(), getWalkableAreas(), getZStepRange(), isBlocking(), isMultiObject(), isMultiPart(), isRestrictedRotation(), isSpecialCost(), isSpecialSpeed(), isStatic(), m_visual, operator!=(), operator==(), removeAllMultiPartIds(), removeMultiPart(), removeMultiPartId(), removeMultiParts(), removeWalkableArea(), setArea(), setBlocking(), setCellStackPosition(), setCost(), setCostId(), setFilename(), setMultiPart(), setRestrictedRotation(), setRotationAnchor(), setSpeed(), setStatic(), and setZStepRange().
Referenced by FIFE::Instance::addStaticColorOverlay(), FIFE::ObjectVisual::create(), FIFE::Instance::createOwnObject(), FIFE::Instance::getStaticColorOverlay(), FIFE::RenderItem::getStaticImageIndexByAngle(), FIFE::Instance::isStaticColorOverlay(), FIFE::ObjectLoader::load(), and FIFE::Instance::removeStaticColorOverlay().
std::list< std::string > FIFE::Object::getWalkableAreas | ( | ) | const |
Returns a list that contains all walkable area ids.
Definition at line 606 of file object.cpp.
References getWalkableAreas(), m_inherited, m_moveProperty, and FIFE::Object::MovableObjectProperty::m_walkableAreas.
Referenced by FIFE::Instance::follow(), FIFE::Route::getLimitedAreas(), getVisual(), getWalkableAreas(), FIFE::Route::isAreaLimited(), FIFE::Instance::move(), and FIFE::Instance::processMovement().
int32_t FIFE::Object::getZStepRange | ( | ) | const |
Returns z-step range from object.
In case it is not limited -1 is returned.
Definition at line 563 of file object.cpp.
References getZStepRange(), m_inherited, m_moveProperty, and FIFE::Object::MovableObjectProperty::m_zRange.
Referenced by FIFE::Instance::follow(), getVisual(), FIFE::Route::getZStepRange(), getZStepRange(), FIFE::Instance::move(), and FIFE::Instance::processMovement().
bool FIFE::Object::isBlocking | ( | ) | const |
Gets if object blocks movement.
Definition at line 223 of file object.cpp.
References isBlocking(), m_basicProperty, FIFE::Object::BasicObjectProperty::m_blocking, and m_inherited.
Referenced by getVisual(), isBlocking(), and FIFE::BlockingInfoRenderer::render().
bool FIFE::Object::isMultiObject | ( | ) | const |
Gets if object uses special cost.
Definition at line 346 of file object.cpp.
References isMultiObject(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiPartIds, and m_multiProperty.
Referenced by getVisual(), FIFE::Instance::Instance(), FIFE::Route::isMultiCell(), FIFE::Instance::isMultiCell(), and isMultiObject().
bool FIFE::Object::isMultiPart | ( | ) | const |
Gets if object is a part of a multi object.
Definition at line 393 of file object.cpp.
References isMultiPart(), m_inherited, FIFE::Object::MultiObjectProperty::m_multiPart, and m_multiProperty.
Referenced by getVisual(), isMultiPart(), FIFE::MapSaver::save(), and FIFE::Instance::update().
bool FIFE::Object::isRestrictedRotation | ( | ) | const |
Gets if object uses restricted rotations.
Definition at line 532 of file object.cpp.
References isRestrictedRotation(), m_inherited, m_multiProperty, and FIFE::Object::MultiObjectProperty::m_restrictedRotation.
Referenced by getVisual(), isRestrictedRotation(), and FIFE::Instance::updateMultiInstances().
bool FIFE::Object::isSpecialCost | ( | ) | const |
Gets if object uses special cost.
Definition at line 275 of file object.cpp.
References isSpecialCost(), FIFE::Object::MovableObjectProperty::m_costId, m_inherited, and m_moveProperty.
Referenced by getVisual(), isSpecialCost(), and FIFE::MapSaver::save().
bool FIFE::Object::isSpecialSpeed | ( | ) | const |
Gets if object uses special speed modifier.
Definition at line 319 of file object.cpp.
References FIFE::Math< T >::Equal(), isSpecialSpeed(), m_inherited, m_moveProperty, and FIFE::Object::MovableObjectProperty::m_speed.
Referenced by getVisual(), isSpecialSpeed(), and FIFE::Instance::isSpecialSpeed().
bool FIFE::Object::isStatic | ( | ) | const |
Gets if object moves.
Definition at line 240 of file object.cpp.
References isStatic(), m_basicProperty, m_inherited, and FIFE::Object::BasicObjectProperty::m_static.
Referenced by getVisual(), isStatic(), and FIFE::LayerCache::updateVisual().
bool FIFE::Object::operator!= | ( | const Object & | obj | ) | const |
Compares unequality of two objects.
Definition at line 620 of file object.cpp.
References getId(), getNamespace(), m_id, and m_namespace.
Referenced by getVisual().
bool FIFE::Object::operator== | ( | const Object & | obj | ) | const |
Compares equality of two objects.
Definition at line 616 of file object.cpp.
References getId(), getNamespace(), m_id, and m_namespace.
Referenced by getVisual().
void FIFE::Object::removeAllMultiPartIds | ( | ) |
Removes all multi part identifiers.
Definition at line 386 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiPartIds, and m_multiProperty.
Referenced by getVisual().
void FIFE::Object::removeMultiPart | ( | Object * | obj | ) |
Removes a multi part object.
obj | A pointer to the part object. |
Definition at line 427 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiParts, and m_multiProperty.
Referenced by getVisual().
void FIFE::Object::removeMultiPartId | ( | const std::string & | partId | ) |
Removes a multi part identifier.
partId | A const reference to a string that holds the identifier. |
Definition at line 373 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiPartIds, and m_multiProperty.
Referenced by getVisual().
void FIFE::Object::removeMultiParts | ( | ) |
Removes all multi part objects.
Definition at line 435 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiParts, and m_multiProperty.
Referenced by getVisual().
void FIFE::Object::removeWalkableArea | ( | const std::string & | id | ) |
Removes an area id from walkable areas.
id | The area id. |
Definition at line 599 of file object.cpp.
References m_moveProperty.
Referenced by getVisual().
void FIFE::Object::setArea | ( | const std::string & | id | ) |
Sets the area id that the instances of this object adds to their cells.
id | The area id, default is "". |
Definition at line 573 of file object.cpp.
References FIFE::Object::BasicObjectProperty::m_area, and m_basicProperty.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setBlocking | ( | bool | blocking | ) |
Sets if object blocks movement.
Definition at line 216 of file object.cpp.
References m_basicProperty, and FIFE::Object::BasicObjectProperty::m_blocking.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setCellStackPosition | ( | uint8_t | position | ) |
Sets the cell stack position.
Is used to determine which Instance is on top of a cell.
position | The stack position on a cell, range 0-255. |
Definition at line 258 of file object.cpp.
References m_basicProperty, and FIFE::Object::BasicObjectProperty::m_cellStack.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setCost | ( | double | cost | ) |
Sets the cost.
cost | A double which value is used as cost. |
Definition at line 302 of file object.cpp.
References FIFE::Object::MovableObjectProperty::m_cost, and m_moveProperty.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setCostId | ( | const std::string & | cost | ) |
Sets the cost id.
cost | A const reference to a string which contains the identifier. |
Definition at line 285 of file object.cpp.
References FIFE::Object::MovableObjectProperty::m_costId, and m_moveProperty.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setDefaultAction | ( | const std::string & | identifier | ) |
Sets default action assigned to this object.
If not available, then default action is not changed.
Definition at line 155 of file object.cpp.
References getAction(), FIFE::Object::BasicObjectProperty::m_actions, m_basicProperty, FIFE::Object::BasicObjectProperty::m_defaultAction, and m_inherited.
Referenced by setId().
void FIFE::Object::setFilename | ( | const std::string & | file | ) |
Definition at line 250 of file object.cpp.
References m_filename.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
|
inline |
Sets the identifier for this object.
Definition at line 73 of file object.h.
References adoptVisual(), createAction(), getAction(), getActionIds(), getDefaultAction(), getInherited(), getPather(), m_id, setDefaultAction(), and setPather().
void FIFE::Object::setMultiPart | ( | bool | part | ) |
Sets the object as a part of a multi object.
part | A boolean, true if the object is a part of a multi object, otherwise false. |
Definition at line 403 of file object.cpp.
References FIFE::Object::MultiObjectProperty::m_multiPart, and m_multiProperty.
Referenced by getVisual(), and FIFE::MapLoader::load().
void FIFE::Object::setPather | ( | IPather * | pather | ) |
Sets pather used by instances created out of this object.
Definition at line 188 of file object.cpp.
References m_moveProperty, and FIFE::Object::MovableObjectProperty::m_pather.
Referenced by FIFE::ObjectLoader::load(), and setId().
void FIFE::Object::setRestrictedRotation | ( | bool | restrict | ) |
Sets the rotation to restricted.
If this is enabled the multi object uses only rotation values are which based on multi coordinates.
restrict | A boolean, if true the rotation will be restricted, false for free rotation. |
Definition at line 525 of file object.cpp.
References m_multiProperty, and FIFE::Object::MultiObjectProperty::m_restrictedRotation.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setRotationAnchor | ( | const ExactModelCoordinate & | anchor | ) |
Sets the rotation anchor for this multi object.
Is used to rotate the images from multi part objects around this relative point, default is 0.0, 0.0 the center of the multi object.
anchor | A const reference to a ExactModelCoordinate that holds the anchor coordinate. |
Definition at line 508 of file object.cpp.
References m_multiProperty, and FIFE::Object::MultiObjectProperty::m_rotationAnchor.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setSpeed | ( | double | cost | ) |
Sets the speed modifier.
cost | A double which value is used as speed multiplier. |
Definition at line 329 of file object.cpp.
References m_moveProperty, and FIFE::Object::MovableObjectProperty::m_speed.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setStatic | ( | bool | stat | ) |
Set to true, if object is such that it doesn't move.
Definition at line 233 of file object.cpp.
References m_basicProperty, and FIFE::Object::BasicObjectProperty::m_static.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
void FIFE::Object::setZStepRange | ( | int32_t | zRange | ) |
Sets z-step range for object.
0 means it can not climb, with a value of 1 it can climb a z-height of 1 and so on.
zRange | The z-step range as int. |
Definition at line 556 of file object.cpp.
References m_moveProperty, and FIFE::Object::MovableObjectProperty::m_zRange.
Referenced by getVisual(), and FIFE::ObjectLoader::load().
|
private |
Definition at line 451 of file object.h.
Referenced by createAction(), getAction(), getActionIds(), getArea(), getCellStackPosition(), getDefaultAction(), isBlocking(), isStatic(), setArea(), setBlocking(), setCellStackPosition(), setDefaultAction(), setStatic(), and ~Object().
|
private |
|
private |
identifier
Definition at line 346 of file object.h.
Referenced by getId(), operator!=(), operator==(), and setId().
|
private |
pointer to inherited object
Definition at line 355 of file object.h.
Referenced by getAction(), getArea(), getCellStackPosition(), getCost(), getCostId(), getDefaultAction(), getInherited(), getMultiObjectCoordinates(), getMultiPartCoordinates(), getMultiPartIds(), getMultiParts(), getPather(), getRestrictedRotation(), getRotationAnchor(), getSpeed(), getWalkableAreas(), getZStepRange(), isBlocking(), isMultiObject(), isMultiPart(), isRestrictedRotation(), isSpecialCost(), isSpecialSpeed(), isStatic(), and setDefaultAction().
|
private |
Definition at line 452 of file object.h.
Referenced by addWalkableArea(), getCost(), getCostId(), getPather(), getSpeed(), getWalkableAreas(), getZStepRange(), isSpecialCost(), isSpecialSpeed(), removeWalkableArea(), setCost(), setCostId(), setPather(), setSpeed(), setZStepRange(), and ~Object().
|
private |
Definition at line 453 of file object.h.
Referenced by addMultiPart(), addMultiPartCoordinate(), addMultiPartId(), getMultiObjectCoordinates(), getMultiPartCoordinates(), getMultiPartIds(), getMultiParts(), getRestrictedRotation(), getRotationAnchor(), isMultiObject(), isMultiPart(), isRestrictedRotation(), removeAllMultiPartIds(), removeMultiPart(), removeMultiPartId(), removeMultiParts(), setMultiPart(), setRestrictedRotation(), setRotationAnchor(), and ~Object().
|
private |
namespace
Definition at line 349 of file object.h.
Referenced by getNamespace(), operator!=(), and operator==().
|
private |
pointer to object visual
Definition at line 358 of file object.h.
Referenced by adoptVisual(), getVisual(), and ~Object().