22 #ifndef FIFE_PROTOTYPE_H 23 #define FIFE_PROTOTYPE_H 62 Object(
const std::string& identifier,
const std::string& name_space,
Object* inherited=NULL);
89 Action*
getAction(
const std::string& identifier,
bool deepsearch =
true)
const;
313 void setArea(
const std::string&
id);
double m_speed
speed modifier, default 1.0
std::list< std::string > getWalkableAreas() const
Returns a list that contains all walkable area ids.
bool operator==(const Object &obj) const
Compares equality of two objects.
const std::string & getFilename() const
Action * getAction(const std::string &identifier, bool deepsearch=true) const
Gets action with given id.
void setDefaultAction(const std::string &identifier)
Sets default action assigned to this object.
std::string getCostId() const
Returns the cost id.
void removeMultiPart(Object *obj)
Removes a multi part object.
IPather * getPather() const
Gets associated pather.
void removeWalkableArea(const std::string &id)
Removes an area id from walkable areas.
std::vector< ModelCoordinate > getMultiObjectCoordinates(int32_t rotation) const
Returns all multi object coordinates for the given rotation.
double getSpeed() const
Returns the speed modifier.
void setArea(const std::string &id)
Sets the area id that the instances of this object adds to their cells.
void adoptVisual(IVisual *visual)
Sets visualization to be used.
void setRotationAnchor(const ExactModelCoordinate &anchor)
Sets the rotation anchor for this multi object.
Action * m_defaultAction
pointer to default action
IPather * m_pather
pointer to pathfinder
void setCellStackPosition(uint8_t position)
Sets the cell stack position.
int32_t m_zRange
z range value
uint8_t m_cellStack
position on cellstack
~BasicObjectProperty()
Destructor.
void setZStepRange(int32_t zRange)
Sets z-step range for 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.
void setFilename(const std::string &file)
std::list< std::string > m_multiPartIds
list with part identifiers
std::string m_namespace
namespace
type_angle2id m_multiAngleMap
multi object angles
std::string m_area
area id
const std::string & getId() const
bool m_blocking
indicates if object blocks
std::string getArea() const
Gets the area id that the instances of this object adds to their cells.
double getCost() const
Returns the cost.
std::string m_costId
cost identifier
void removeAllMultiPartIds()
Removes all multi part identifiers.
void removeMultiPartId(const std::string &partId)
Removes a multi part identifier.
uint8_t getCellStackPosition() const
Returns cell stack position.
MovableObjectProperty * m_moveProperty
bool isStatic() const
Gets if object moves.
void setMultiPart(bool part)
Sets the object as a part of a multi object.
std::string m_id
identifier
bool operator!=(const Object &obj) const
Compares unequality of two objects.
std::set< Object * > m_multiParts
set contains part objects
const std::string & getNamespace() const
void setId(const std::string &id)
Sets the identifier for this object.
void setRestrictedRotation(bool restrict)
Sets the rotation to restricted.
void addMultiPartCoordinate(int32_t rotation, ModelCoordinate coord)
Adds rotationally dependent coordinates for this object part.
std::multimap< int32_t, ModelCoordinate > m_multiObjectCoordinates
multi object coordinates
BasicObjectProperty * m_basicProperty
std::list< std::string > getActionIds() const
Gets all available action ids of the object and packs them into a list.
bool isRestrictedRotation() const
Gets if object uses restricted rotations.
bool isBlocking() const
Gets if object blocks movement.
bool isMultiObject() const
Gets if object uses special cost.
type_angle2id m_partAngleMap
part object angles
Object * m_inherited
pointer to inherited object
void setCost(double cost)
Sets the cost.
ExactModelCoordinate getRotationAnchor() const
Returns the rotation anchor for this multi object.
void removeMultiParts()
Removes all multi part objects.
Object * getInherited() const
Gets an object where this object was inherited from.
Action * createAction(const std::string &identifier, bool is_default=false)
Adds new action with given id.
MultiObjectProperty * m_multiProperty
std::multimap< int32_t, ModelCoordinate > getMultiPartCoordinates() const
Returns all rotationally dependent coordinates from this object part.
std::string m_filename
filename
void addMultiPart(Object *obj)
Adds a object as a part of a multi object.
std::list< std::string > m_walkableAreas
list contains walkable area ids
double m_cost
cost value, default 1.0
void addMultiPartId(const std::string &partId)
Adds a multi part identifier.
std::multimap< int32_t, ModelCoordinate > m_multiPartCoordinates
part object coordinates
void setStatic(bool stat)
Set to true, if object is such that it doesn't move.
std::list< std::string > getMultiPartIds() const
Returns all multi part identifiers.
Action * getDefaultAction() const
Gets default action assigned to this object.
int32_t getZStepRange() const
Returns z-step range from object.
std::map< std::string, Action * > * m_actions
holds action ids and assigned actions
bool m_multiPart
indicates if object is part of multi object
std::map< uint32_t, int32_t > type_angle2id
void addWalkableArea(const std::string &id)
Adds an area id to walkable area.
std::set< Object * > getMultiParts() const
Returns all multi part objects.
void setPather(IPather *pather)
Sets pather used by instances created out of this object.
bool m_restrictedRotation
indicates if object uses only restricted rotations
bool m_static
indicates if object is static
void setBlocking(bool blocking)
Sets if object blocks movement.
bool isSpecialSpeed() const
Gets if object uses special speed modifier.
T * getVisual() const
Gets used visualization.
BasicObjectProperty()
Constructor.
void setSpeed(double cost)
Sets the speed modifier.
bool isSpecialCost() const
Gets if object uses special cost.
int32_t getRestrictedRotation(int32_t rotation)
Returns the most obvious rotation, based on multi coordinates.
ExactModelCoordinate m_rotationAnchor
rotation anchor
void setCostId(const std::string &cost)
Sets the cost id.
bool isMultiPart() const
Gets if object is a part of a multi object.
IVisual * m_visual
pointer to object visual