FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::Object Class Reference

Object class. More...

#include <object.h>

+ Collaboration diagram for FIFE::Object:

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...
 
ActioncreateAction (const std::string &identifier, bool is_default=false)
 Adds new action with given id. More...
 
ActiongetAction (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...
 
ActiongetDefaultAction () const
 Gets default action assigned to this object. More...
 
void setPather (IPather *pather)
 Sets pather used by instances created out of this object. More...
 
IPathergetPather () const
 Gets associated pather. More...
 
ObjectgetInherited () 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, ModelCoordinategetMultiPartCoordinates () const
 Returns all rotationally dependent coordinates from this object part. More...
 
std::vector< ModelCoordinategetMultiPartCoordinates (int32_t rotation) const
 Returns all object part coordinates for the given rotation. More...
 
std::vector< ModelCoordinategetMultiObjectCoordinates (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...
 
Objectm_inherited
 pointer to inherited object More...
 
IVisualm_visual
 pointer to object visual More...
 
BasicObjectPropertym_basicProperty
 
MovableObjectPropertym_moveProperty
 
MultiObjectPropertym_multiProperty
 

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

◆ 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

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

Definition at line 74 of file object.cpp.

◆ ~Object()

FIFE::Object::~Object ( )

Destructor.

Definition at line 85 of file object.cpp.

References m_basicProperty, m_moveProperty, m_multiProperty, and m_visual.

Member Function Documentation

◆ addMultiPart()

void FIFE::Object::addMultiPart ( Object obj)

Adds a object as a part of a multi object.

Parameters
objA 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().

+ Here is the caller graph for this function:

◆ addMultiPartCoordinate()

void FIFE::Object::addMultiPartCoordinate ( int32_t  rotation,
ModelCoordinate  coord 
)

Adds rotationally dependent coordinates for this object part.

Parameters
rotationA integer value for the angle.
coordA 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().

+ Here is the caller graph for this function:

◆ addMultiPartId()

void FIFE::Object::addMultiPartId ( const std::string &  partId)

Adds a multi part identifier.

Parameters
partIdA 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().

+ Here is the caller graph for this function:

◆ addWalkableArea()

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.

Parameters
idThe 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().

+ Here is the caller graph for this function:

◆ adoptVisual()

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

+ Here is the caller graph for this function:

◆ createAction()

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
identifierAn identifier or name to give the action.
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 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().

+ Here is the caller graph for this function:

◆ getAction()

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

+ Here is the caller graph for this function:

◆ getActionIds()

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

+ Here is the caller graph for this function:

◆ getArea()

std::string FIFE::Object::getArea ( ) const

Gets the area id that the instances of this object adds to their cells.

Returns
The area id, default is "".

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

+ Here is the caller graph for this function:

◆ getCellStackPosition()

uint8_t FIFE::Object::getCellStackPosition ( ) const

Returns cell stack position.

Returns
The stack position on a cell, range 0-255.

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

+ Here is the caller graph for this function:

◆ getCost()

double FIFE::Object::getCost ( ) const

Returns the cost.

Returns
A double which value is used as 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().

+ Here is the caller graph for this function:

◆ getCostId()

std::string FIFE::Object::getCostId ( ) const

Returns the cost id.

Returns
A const reference to a string which contains the identifier.

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

+ Here is the caller graph for this function:

◆ getDefaultAction()

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

+ Here is the caller graph for this function:

◆ getFilename()

const std::string & FIFE::Object::getFilename ( ) const

Definition at line 254 of file object.cpp.

References m_filename.

Referenced by getVisual().

+ Here is the caller graph for this function:

◆ getId()

const std::string& FIFE::Object::getId ( ) const
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().

+ Here is the caller graph for this function:

◆ getInherited()

Object * FIFE::Object::getInherited ( ) const

Gets an object where this object was inherited from.

See also
inherited object

Definition at line 205 of file object.cpp.

References m_inherited.

Referenced by setId().

+ Here is the caller graph for this function:

◆ getMultiObjectCoordinates()

std::vector< ModelCoordinate > FIFE::Object::getMultiObjectCoordinates ( int32_t  rotation) const

Returns all multi object coordinates for the given rotation.

Parameters
rotationA integer value for the angle.
Returns
A vector which contains the coordinates.

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

+ Here is the caller graph for this function:

◆ getMultiPartCoordinates() [1/2]

std::multimap< int32_t, ModelCoordinate > FIFE::Object::getMultiPartCoordinates ( ) const

Returns all rotationally dependent coordinates from this object part.

Returns
A const reference to a multimap which contains the coordinates per rotation.

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

+ Here is the caller graph for this function:

◆ getMultiPartCoordinates() [2/2]

std::vector< ModelCoordinate > FIFE::Object::getMultiPartCoordinates ( int32_t  rotation) const

Returns all object part coordinates for the given rotation.

Parameters
rotationA integer value for the angle.
Returns
A vector which contains the coordinates.

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.

◆ getMultiPartIds()

std::list< std::string > FIFE::Object::getMultiPartIds ( ) const

Returns all multi part identifiers.

Returns
A const reference to a list that holds the 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().

+ Here is the caller graph for this function:

◆ getMultiParts()

std::set< Object * > FIFE::Object::getMultiParts ( ) const

Returns all multi part objects.

Returns
A const reference to a set that holds the 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().

+ Here is the caller graph for this function:

◆ getNamespace()

const std::string& FIFE::Object::getNamespace ( ) const
inline

◆ getPather()

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

+ Here is the caller graph for this function:

◆ getRestrictedRotation()

int32_t FIFE::Object::getRestrictedRotation ( int32_t  rotation)

Returns the most obvious rotation, based on multi coordinates.

Parameters
rotationA integer value for the original angle.
Returns
A integer value for the obvious rotation.

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

+ Here is the caller graph for this function:

◆ getRotationAnchor()

ExactModelCoordinate FIFE::Object::getRotationAnchor ( ) const

Returns the rotation anchor for this multi object.

Returns
A const reference to a ExactModelCoordinate that holds the anchor coordinate.

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

+ Here is the caller graph for this function:

◆ getSpeed()

double FIFE::Object::getSpeed ( ) const

Returns the speed modifier.

Returns
A double which value is used as speed multiplier.

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

+ Here is the caller graph for this function:

◆ getVisual()

◆ getWalkableAreas()

std::list< std::string > FIFE::Object::getWalkableAreas ( ) const

Returns a list that contains all walkable area ids.

Returns
A list that contains all walkable area ids as strings.

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

+ Here is the caller graph for this function:

◆ getZStepRange()

int32_t FIFE::Object::getZStepRange ( ) const

Returns z-step range from object.

In case it is not limited -1 is returned.

Returns
The z-step range as int.

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

+ Here is the caller graph for this function:

◆ isBlocking()

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

+ Here is the caller graph for this function:

◆ isMultiObject()

bool FIFE::Object::isMultiObject ( ) const

Gets if object uses special cost.

Returns
A boolean, true if the object uses special cost, otherwise false.

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

+ Here is the caller graph for this function:

◆ isMultiPart()

bool FIFE::Object::isMultiPart ( ) const

Gets if object is a part of a multi object.

Returns
A boolean, true if the object is a part of a multi object, otherwise false.

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

+ Here is the caller graph for this function:

◆ isRestrictedRotation()

bool FIFE::Object::isRestrictedRotation ( ) const

Gets if object uses restricted rotations.

Returns
A boolean, true if the object uses restricted rotations, otherwise false.

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

+ Here is the caller graph for this function:

◆ isSpecialCost()

bool FIFE::Object::isSpecialCost ( ) const

Gets if object uses special cost.

Returns
A boolean, true if the object uses special cost, otherwise false.

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

+ Here is the caller graph for this function:

◆ isSpecialSpeed()

bool FIFE::Object::isSpecialSpeed ( ) const

Gets if object uses special speed modifier.

Returns
A boolean, true if the object uses special speed, otherwise false.

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

+ Here is the caller graph for this function:

◆ isStatic()

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

+ Here is the caller graph for this function:

◆ operator!=()

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

+ Here is the caller graph for this function:

◆ operator==()

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

+ Here is the caller graph for this function:

◆ removeAllMultiPartIds()

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

+ Here is the caller graph for this function:

◆ removeMultiPart()

void FIFE::Object::removeMultiPart ( Object obj)

Removes a multi part object.

Parameters
objA 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().

+ Here is the caller graph for this function:

◆ removeMultiPartId()

void FIFE::Object::removeMultiPartId ( const std::string &  partId)

Removes a multi part identifier.

Parameters
partIdA 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().

+ Here is the caller graph for this function:

◆ removeMultiParts()

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

+ Here is the caller graph for this function:

◆ removeWalkableArea()

void FIFE::Object::removeWalkableArea ( const std::string &  id)

Removes an area id from walkable areas.

Parameters
idThe area id.

Definition at line 599 of file object.cpp.

References m_moveProperty.

Referenced by getVisual().

+ Here is the caller graph for this function:

◆ setArea()

void FIFE::Object::setArea ( const std::string &  id)

Sets the area id that the instances of this object adds to their cells.

Parameters
idThe 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().

+ Here is the caller graph for this function:

◆ setBlocking()

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

+ Here is the caller graph for this function:

◆ setCellStackPosition()

void FIFE::Object::setCellStackPosition ( uint8_t  position)

Sets the cell stack position.

Is used to determine which Instance is on top of a cell.

Parameters
positionThe 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().

+ Here is the caller graph for this function:

◆ setCost()

void FIFE::Object::setCost ( double  cost)

Sets the cost.

Parameters
costA 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().

+ Here is the caller graph for this function:

◆ setCostId()

void FIFE::Object::setCostId ( const std::string &  cost)

Sets the cost id.

Parameters
costA 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().

+ Here is the caller graph for this function:

◆ setDefaultAction()

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

+ Here is the caller graph for this function:

◆ setFilename()

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

+ Here is the caller graph for this function:

◆ setId()

void FIFE::Object::setId ( const std::string &  id)
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().

◆ setMultiPart()

void FIFE::Object::setMultiPart ( bool  part)

Sets the object as a part of a multi object.

Parameters
partA 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().

+ Here is the caller graph for this function:

◆ setPather()

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

+ Here is the caller graph for this function:

◆ setRestrictedRotation()

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.

Parameters
restrictA 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().

+ Here is the caller graph for this function:

◆ setRotationAnchor()

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.

Parameters
anchorA 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().

+ Here is the caller graph for this function:

◆ setSpeed()

void FIFE::Object::setSpeed ( double  cost)

Sets the speed modifier.

Parameters
costA 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().

+ Here is the caller graph for this function:

◆ setStatic()

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

+ Here is the caller graph for this function:

◆ setZStepRange()

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.

Parameters
zRangeThe 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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_basicProperty

◆ m_filename

std::string FIFE::Object::m_filename
private

filename

Definition at line 352 of file object.h.

Referenced by getFilename(), and setFilename().

◆ m_id

std::string FIFE::Object::m_id
private

identifier

Definition at line 346 of file object.h.

Referenced by getId(), operator!=(), operator==(), and setId().

◆ m_inherited

◆ m_moveProperty

◆ m_multiProperty

◆ m_namespace

std::string FIFE::Object::m_namespace
private

namespace

Definition at line 349 of file object.h.

Referenced by getNamespace(), operator!=(), and operator==().

◆ m_visual

IVisual* FIFE::Object::m_visual
private

pointer to object visual

Definition at line 358 of file object.h.

Referenced by adoptVisual(), getVisual(), and ~Object().


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