|
FIFE
|
An Instance is an "instantiation" of an Object at a Location. More...
#include <instance.h>
Inheritance diagram for FIFE::Instance:
Collaboration diagram for FIFE::Instance:Classes | |
| class | InstanceActivity |
| InstanceActivity gets allocated in case there is some runtime activity related to the instance. More... | |
Public Member Functions | |
| Instance (Object *object, const Location &location, const std::string &identifier="") | |
| Constructor Instances are created by calling addInstance from layer, thus this method should really be called only by layer or test code. More... | |
| virtual | ~Instance () |
| Destructor. More... | |
| const std::string & | getId () |
| Get the identifier for this instance; possibly null. More... | |
| void | setId (const std::string &identifier="") |
| Set the identifier for this instance. More... | |
| Object * | getObject () |
| Gets object where this instance is instantiated from. More... | |
| void | setLocation (const Location &loc) |
| Sets location of the instance. More... | |
| Location | getLocation () const |
| Gets current location of instance. More... | |
| Location & | getLocationRef () |
| Gets reference of current location of instance. More... | |
| Location | getTargetLocation () const |
| Gets movement target in case instance is moving. More... | |
| void | setFacingLocation (const Location &loc) |
| Sets the direction where instance is heading. More... | |
| Location | getFacingLocation () |
| Returns the direction where instance is heading. More... | |
| Location & | getOldLocationRef () |
| Gets reference of old location of instance. More... | |
| void | setRotation (int32_t rotation) |
| Set the rotation offset of this instance. More... | |
| int32_t | getRotation () const |
| Get the rotation offset of this instance Returns direction where instance is heading. More... | |
| int32_t | getOldRotation () const |
| Get the old rotation offset of this instance Returns direction where instance was heading. More... | |
| void | setBlocking (bool blocking) |
| Sets if instance blocks movement. More... | |
| bool | isBlocking () const |
| Gets if instance blocks movement. More... | |
| void | setOverrideBlocking (bool overblock) |
| Sets if instance blocking can overriden. More... | |
| bool | isOverrideBlocking () const |
| Gets if instance blocking can overriden. More... | |
| void | callOnActionFrame (Action *action, int32_t frame) |
| Auxiliary function to inform ActionListeners about the active ActionFrame. More... | |
| void | addActionListener (InstanceActionListener *listener) |
| Adds new instance action listener. More... | |
| void | removeActionListener (InstanceActionListener *listener) |
| Removes associated instance action listener. More... | |
| void | addChangeListener (InstanceChangeListener *listener) |
| Adds new instance change listener. More... | |
| void | removeChangeListener (InstanceChangeListener *listener) |
| Removes associated instance change listener. More... | |
| void | addDeleteListener (InstanceDeleteListener *listener) |
| Adds new instance delete listener. More... | |
| void | removeDeleteListener (InstanceDeleteListener *listener) |
| Removes associated instance delete listener. More... | |
| Action * | getCurrentAction () const |
| Gets the currently active action. More... | |
| double | getMovementSpeed () const |
| Gets the speed in case instance is moving otherwise returns 0. More... | |
| uint32_t | getActionRuntime () |
| Gets the time in milliseconds how long action has been active In case there is no current action, returns -1. More... | |
| void | setActionRuntime (uint32_t time_offset) |
| Sets the time in milliseconds how long an action has been active This was requested in Ticket #373. More... | |
| void | move (const std::string &actionName, const Location &target, const double speed, const std::string &costId="") |
| Performs given named action to the instance. More... | |
| void | actOnce (const std::string &actionName, const Location &direction) |
| Performs given named action to the instance, once only. More... | |
| void | actOnce (const std::string &actionName, int32_t rotation) |
| Performs given named action to the instance, once only. More... | |
| void | actOnce (const std::string &actionName) |
| Performs given named action to the instance, once only. More... | |
| void | actRepeat (const std::string &actionName, const Location &direction) |
| Performs given named action to the instance, repeated. More... | |
| void | actRepeat (const std::string &actionName, int32_t rotation) |
| Performs given named action to the instance, repeated Performs no movement. More... | |
| void | actRepeat (const std::string &actionName) |
| Performs given named action to the instance, repeated. More... | |
| void | say (const std::string &text, uint32_t duration=0) |
| Causes instance to "say" given text (shown on screen next to the instance) More... | |
| void | follow (const std::string &actionName, Instance *leader, const double speed) |
| Performs given named action to the instance. More... | |
| void | follow (const std::string &actionName, Route *route, const double speed) |
| Performs given named action to the instance. More... | |
| void | cancelMovement (uint32_t length=1) |
| Cancel movement after a given length. More... | |
| const std::string * | getSayText () const |
| Returns pointer to currently set saytext. More... | |
| InstanceChangeInfo | update () |
| Updates the instance related to the current action. More... | |
| bool | isActive () const |
| If this returns true, the instance needs to be updated. More... | |
| void | setVisual (IVisual *visual) |
| Sets visualization to be used. More... | |
| template<typename T > | |
| T * | getVisual () const |
| Gets used visualization. More... | |
| void | callOnTransparencyChange () |
| void | callOnVisibleChange () |
| void | callOnStackPositionChange () |
| void | setTimeMultiplier (float multip) |
| Sets speed for the map. More... | |
| float | getTimeMultiplier () |
| Gets instance speed. More... | |
| float | getTotalTimeMultiplier () |
| Gets instance speed, considering also model and map speeds. More... | |
| uint32_t | getRuntime () |
| Gets the scaled runtime in milliseconds. More... | |
| void | refresh () |
| Refreshes instance e.g. More... | |
| InstanceChangeInfo | getChangeInfo () |
| Returns a bitmask of changes of the last update. More... | |
| void | onInstanceDeleted (Instance *instance) |
| callback so other instances we depend on can notify us if they go away More... | |
| Route * | getRoute () |
| Returns a pointer to the route, in case there is no, it returns NULL. More... | |
| void | setVisitor (bool visit) |
| Marks this instance as a visitor. More... | |
| bool | isVisitor () |
| If instance is a visitor it returns true otherwise false. More... | |
| void | setVisitorShape (VisitorShapeInfo info) |
| Sets the shape type for a visitor. More... | |
| VisitorShapeInfo | getVisitorShape () |
| Gets the shape type for a visitor. More... | |
| void | setVisitorRadius (uint16_t radius) |
| Sets the range for a visitor. More... | |
| uint16_t | getVisitorRadius () |
| Gets the visitor range. More... | |
| void | setCellStackPosition (uint8_t stack) |
| Sets the cell stack position. More... | |
| uint8_t | getCellStackPosition () |
| Gets the cell stack position. More... | |
| bool | isSpecialCost () |
| Returns true if instance or object have special cost otherwise false. More... | |
| void | setCost (const std::string &id, double cost) |
| Sets for the given cost id a cost. More... | |
| void | resetCost () |
| Resets cost. More... | |
| double | getCost () |
| Returns cost value. More... | |
| std::string | getCostId () |
| Returns cost id. More... | |
| double | getSpeed () |
| Returns speed modifier. More... | |
| bool | isSpecialSpeed () |
| Returns true if instance or object have special speed modifier otherwise false. More... | |
| bool | isMultiCell () |
| Returns true if it is multi cell otherwise false. More... | |
| bool | isMultiObject () |
| Returns true if it is multi object otherwise false. More... | |
| void | updateMultiInstances () |
| Updates the visual positions of all instances in case this is a multi object. More... | |
| const std::vector< Instance * > & | getMultiInstances () |
| Returns a vector that contains all instances of a multi object. More... | |
| void | setMainMultiInstance (Instance *main) |
| Sets a instance to the main multi instance of this instance. More... | |
| Instance * | getMainMultiInstance () |
| Returns a pointer to the main mulit instance or Null if the instance is not part of a multi instance object. More... | |
| void | addStaticColorOverlay (uint32_t angle, const OverlayColors &colors) |
| Adds new static color overlay with given angle (degrees). More... | |
| OverlayColors * | getStaticColorOverlay (int32_t angle) |
| Returns closest matching static color overlay for given angle. More... | |
| void | removeStaticColorOverlay (int32_t angle) |
| Removes a static color overlay with given angle (degrees). More... | |
| bool | isStaticColorOverlay () |
| Indicates if there exists a static color overlay. More... | |
| void | addColorOverlay (const std::string &actionName, uint32_t angle, const OverlayColors &colors) |
| Adds new color overlay with given angle (degrees) to given action. More... | |
| OverlayColors * | getColorOverlay (const std::string &actionName, uint32_t angle) |
| Returns closest matching color overlay for given angle and action. More... | |
| void | removeColorOverlay (const std::string &actionName, int32_t angle) |
| Removes a color overlay with given angle (degrees) from given action. More... | |
| void | addAnimationOverlay (const std::string &actionName, uint32_t angle, int32_t order, const AnimationPtr &animationptr) |
| Adds new animation overlay with given angle (degrees) and order to given action. More... | |
| std::map< int32_t, AnimationPtr > | getAnimationOverlay (const std::string &actionName, int32_t angle) |
| Gets map with animations closest to given angle. More... | |
| void | removeAnimationOverlay (const std::string &actionName, uint32_t angle, int32_t order) |
| Removes animation overlay with given angle (degrees) and order from action. More... | |
| void | addColorOverlay (const std::string &actionName, uint32_t angle, int32_t order, const OverlayColors &colors) |
| Adds new color overlay with given angle (degrees) and order to given action animation overlay. More... | |
| OverlayColors * | getColorOverlay (const std::string &actionName, uint32_t angle, int32_t order) |
| Returns closest matching color overlay for given angle, order and action animation overlay. More... | |
| void | removeColorOverlay (const std::string &actionName, int32_t angle, int32_t order) |
| Removes a color overlay with given angle (degrees), order from given action animation overlay. More... | |
| void | convertToOverlays (const std::string &actionName, bool color) |
| If the action have base animation and optional color overlay it gets converted to animation overlay. More... | |
| bool | isAnimationOverlay (const std::string &actionName) |
| Indicates if there exists a animation overlay for given action. More... | |
| bool | isColorOverlay (const std::string &actionName) |
| Indicates if there exists a color overlay for given action or animation overlay. More... | |
Public Member Functions inherited from FIFE::FifeClass | |
| FifeClass () | |
| virtual | ~FifeClass () |
| fifeid_t | getFifeId () |
| Gets unique id of this instance inside the engine. More... | |
Public Member Functions inherited from FIFE::InstanceDeleteListener | |
| virtual | ~InstanceDeleteListener () |
Private Member Functions | |
| Instance (const Instance &) | |
| Instance & | operator= (const Instance &) |
| void | finalizeAction () |
| Finalize current action. More... | |
| void | cancelAction () |
| Cancel current action. More... | |
| void | initializeAction (const std::string &actionName) |
| Initialize action for use. More... | |
| bool | processMovement () |
| Moves instance. Returns true if finished. More... | |
| void | calcMovement () |
| Calculates movement based current location and speed. More... | |
| void | bindTimeProvider () |
| rebinds time provider based on new location More... | |
| void | initializeChanges () |
| called when instance has been changed. Causes instance to create InstanceActivity More... | |
| void | prepareForUpdate () |
| called to prepare the instance for an update More... | |
| void | createOwnObject () |
| Creates an own object for the instance to allow visual customization. More... | |
| ActionVisual * | getActionVisual (const std::string &actionName, bool create) |
| Returns pointer to action visual, can also create it. More... | |
Private Attributes | |
| std::string | m_id |
| int32_t | m_rotation |
| The rotation offset of this instance. More... | |
| InstanceActivity * | m_activity |
| InstanceChangeInfo | m_changeInfo |
| bitmask stating current changes More... | |
| std::vector < InstanceDeleteListener * > | m_deleteListeners |
| listeners for deletion of the instance More... | |
| Object * | m_object |
| object where instantiated from More... | |
| bool | m_ownObject |
| indicates if m_object is customized More... | |
| Location | m_location |
| current location More... | |
| IVisual * | m_visual |
| instance visualization More... | |
| bool | m_blocking |
| instance blocking info More... | |
| bool | m_overrideBlocking |
| allow to override the blocking property More... | |
| bool | m_isVisitor |
| is instance a visitor (FoW) More... | |
| VisitorShapeInfo | m_visitorShape |
| visitor shape type More... | |
| uint16_t | m_visitorRadius |
| visitor radius (FoW) More... | |
| uint8_t | m_cellStackPos |
| position on cell stack More... | |
| bool | m_specialCost |
| indicates special cost More... | |
| double | m_cost |
| holds cost value More... | |
| std::string | m_costId |
| holds cost id More... | |
| std::vector< Instance * > | m_multiInstances |
| vector that holds all multi instances More... | |
| Instance * | m_mainMultiInstance |
| pointer to the main multi instance More... | |
An Instance is an "instantiation" of an Object at a Location.
Definition at line 100 of file instance.h.
| FIFE::Instance::Instance | ( | Object * | object, |
| const Location & | location, | ||
| const std::string & | identifier = "" |
||
| ) |
Constructor Instances are created by calling addInstance from layer, thus this method should really be called only by layer or test code.
Definition at line 194 of file instance.cpp.
References addDeleteListener(), FIFE::InstanceVisual::create(), FIFE::Layer::createInstance(), FIFE::Location::getExactLayerCoordinatesRef(), FIFE::Location::getLayer(), FIFE::Object::isMultiObject(), m_location, m_mainMultiInstance, m_multiInstances, m_object, m_rotation, setMainMultiInstance(), FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.
|
virtual |
Destructor.
Definition at line 241 of file instance.cpp.
References finalizeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, FIFE::Instance::InstanceActivity::m_actionListeners, m_activity, m_deleteListeners, m_multiInstances, m_object, m_ownObject, and m_visual.
|
private |
| void FIFE::Instance::actOnce | ( | const std::string & | actionName, |
| const Location & | direction | ||
| ) |
Performs given named action to the instance, once only.
Performs no movement
| actionName | name of the action |
| direction | coordinates for cell towards instance is heading to when performing the action |
Definition at line 579 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_repeating, and setFacingLocation().
| void FIFE::Instance::actOnce | ( | const std::string & | actionName, |
| int32_t | rotation | ||
| ) |
Performs given named action to the instance, once only.
Performs no movement
| actionName | name of the action |
| rotation | rotation which the instance use when performing the action |
Definition at line 585 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_repeating, and setRotation().
| void FIFE::Instance::actOnce | ( | const std::string & | actionName | ) |
Performs given named action to the instance, once only.
Performs no movement and use current rotation
| actionName | name of the action |
Definition at line 591 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::ActionInfo::m_repeating.
| void FIFE::Instance::actRepeat | ( | const std::string & | actionName, |
| const Location & | direction | ||
| ) |
Performs given named action to the instance, repeated.
Performs no movement
| actionName | name of the action |
| direction | coordinates for cell towards instance is heading to when performing the action |
Definition at line 596 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_repeating, and setFacingLocation().
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:| void FIFE::Instance::actRepeat | ( | const std::string & | actionName, |
| int32_t | rotation | ||
| ) |
Performs given named action to the instance, repeated Performs no movement.
| actionName | name of the action |
| rotation | rotation which the instance use when performing the action |
Definition at line 602 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_repeating, and setRotation().
| void FIFE::Instance::actRepeat | ( | const std::string & | actionName | ) |
Performs given named action to the instance, repeated.
Performs no movement and use current rotation
| actionName | name of the action |
Definition at line 608 of file instance.cpp.
References initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::ActionInfo::m_repeating.
| void FIFE::Instance::addActionListener | ( | InstanceActionListener * | listener | ) |
Adds new instance action listener.
| listener | to add |
Definition at line 361 of file instance.cpp.
References initializeChanges(), FIFE::Instance::InstanceActivity::m_actionListeners, and m_activity.
| void FIFE::Instance::addAnimationOverlay | ( | const std::string & | actionName, |
| uint32_t | angle, | ||
| int32_t | order, | ||
| const AnimationPtr & | animationptr | ||
| ) |
Adds new animation overlay with given angle (degrees) and order to given action.
Definition at line 1148 of file instance.cpp.
References FIFE::ActionVisual::addAnimationOverlay(), getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
| void FIFE::Instance::addChangeListener | ( | InstanceChangeListener * | listener | ) |
Adds new instance change listener.
| listener | to add |
Definition at line 381 of file instance.cpp.
References initializeChanges(), m_activity, and FIFE::Instance::InstanceActivity::m_changeListeners.
Referenced by FIFE::Trigger::attach().
Here is the caller graph for this function:| void FIFE::Instance::addColorOverlay | ( | const std::string & | actionName, |
| uint32_t | angle, | ||
| const OverlayColors & | colors | ||
| ) |
Adds new color overlay with given angle (degrees) to given action.
Definition at line 1122 of file instance.cpp.
References FIFE::ActionVisual::addColorOverlay(), getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
| void FIFE::Instance::addColorOverlay | ( | const std::string & | actionName, |
| uint32_t | angle, | ||
| int32_t | order, | ||
| const OverlayColors & | colors | ||
| ) |
Adds new color overlay with given angle (degrees) and order to given action animation overlay.
Definition at line 1174 of file instance.cpp.
References FIFE::ActionVisual::addColorOverlay(), getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
| void FIFE::Instance::addDeleteListener | ( | InstanceDeleteListener * | listener | ) |
Adds new instance delete listener.
| listener | to add |
Definition at line 1265 of file instance.cpp.
References m_deleteListeners.
Referenced by FIFE::InstanceRenderer::addColored(), FIFE::RendererNode::addInstance(), FIFE::InstanceRenderer::addOutlined(), FIFE::InstanceRenderer::addTransparentArea(), FIFE::Trigger::attach(), FIFE::RendererNode::changeInstance(), follow(), and Instance().
Here is the caller graph for this function:| void FIFE::Instance::addStaticColorOverlay | ( | uint32_t | angle, |
| const OverlayColors & | colors | ||
| ) |
Adds new static color overlay with given angle (degrees).
Definition at line 1087 of file instance.cpp.
References FIFE::ObjectVisual::addStaticColorOverlay(), createOwnObject(), FIFE::Object::getVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, m_object, m_ownObject, and prepareForUpdate().
|
private |
rebinds time provider based on new location
Definition at line 926 of file instance.cpp.
References FIFE::Location::getLayer(), FIFE::Layer::getMap(), FIFE::TimeProvider::getMultiplier(), FIFE::Map::getTimeProvider(), m_activity, m_location, FIFE::Instance::InstanceActivity::m_timeProvider, and FIFE::TimeProvider::setMultiplier().
Referenced by getActionRuntime(), getRuntime(), refresh(), setTimeMultiplier(), and update().
Here is the caller graph for this function:
|
private |
Calculates movement based current location and speed.
| void FIFE::Instance::callOnActionFrame | ( | Action * | action, |
| int32_t | frame | ||
| ) |
Auxiliary function to inform ActionListeners about the active ActionFrame.
| action | pointer to the action |
| frame | frame index number of the animation |
Definition at line 386 of file instance.cpp.
References FIFE::Instance::InstanceActivity::m_actionListeners, and m_activity.
Referenced by FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:| void FIFE::Instance::callOnStackPositionChange | ( | ) |
Definition at line 968 of file instance.cpp.
References FIFE::ICHANGE_STACKPOS, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
Referenced by FIFE::InstanceVisual::setStackPosition().
Here is the caller graph for this function:| void FIFE::Instance::callOnTransparencyChange | ( | ) |
Definition at line 958 of file instance.cpp.
References FIFE::ICHANGE_TRANSPARENCY, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
Referenced by FIFE::InstanceVisual::setTransparency().
Here is the caller graph for this function:| void FIFE::Instance::callOnVisibleChange | ( | ) |
Definition at line 963 of file instance.cpp.
References FIFE::ICHANGE_VISIBLE, m_activity, FIFE::Instance::InstanceActivity::m_additional, and prepareForUpdate().
Referenced by FIFE::InstanceVisual::setVisible().
Here is the caller graph for this function:
|
private |
Cancel current action.
Definition at line 835 of file instance.cpp.
References FIFE::_log, FL_DBG, isMultiObject(), FIFE::ActionInfo::m_action, FIFE::Instance::InstanceActivity::m_action, FIFE::Instance::InstanceActivity::m_actionInfo, FIFE::Instance::InstanceActivity::m_actionListeners, m_activity, FIFE::ActionInfo::m_leader, m_multiInstances, and removeDeleteListener().
Referenced by initializeAction().
Here is the caller graph for this function:| void FIFE::Instance::cancelMovement | ( | uint32_t | length = 1 | ) |
Cancel movement after a given length.
If no length is set then 1 is used. This means that the instance stops at the center of the next cell (can be the same as the current).
Definition at line 509 of file instance.cpp.
References FIFE::Route::cutPath(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::ActionInfo::m_route.
| void FIFE::Instance::convertToOverlays | ( | const std::string & | actionName, |
| bool | color | ||
| ) |
If the action have base animation and optional color overlay it gets converted to animation overlay.
Definition at line 1216 of file instance.cpp.
References FIFE::ActionVisual::convertToOverlays(), and getActionVisual().
|
private |
Creates an own object for the instance to allow visual customization.
Definition at line 1221 of file instance.cpp.
References FIFE::Object::adoptVisual(), FIFE::ObjectVisual::create(), FIFE::Object::getId(), FIFE::Object::getNamespace(), FIFE::Object::getVisual(), m_object, and m_ownObject.
Referenced by addStaticColorOverlay(), and getActionVisual().
Here is the caller graph for this function:
|
private |
Finalize current action.
Definition at line 800 of file instance.cpp.
References FIFE::_log, FL_DBG, isMultiObject(), FIFE::ActionInfo::m_action, FIFE::Instance::InstanceActivity::m_action, FIFE::Instance::InstanceActivity::m_actionInfo, FIFE::Instance::InstanceActivity::m_actionListeners, m_activity, FIFE::ActionInfo::m_leader, m_multiInstances, and removeDeleteListener().
Referenced by move(), update(), and ~Instance().
Here is the caller graph for this function:| void FIFE::Instance::follow | ( | const std::string & | actionName, |
| Instance * | leader, | ||
| const double | speed | ||
| ) |
Performs given named action to the instance.
While performing the action follows given instance with given speed
| actionName | name of the action |
| leader | followed instance |
| speed | speed used for movement. Units = distance 1 in layer coordinates per second |
Definition at line 484 of file instance.cpp.
References FIFE::_log, addDeleteListener(), FL_DBG, getLocationRef(), initializeAction(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_leader, m_location, FIFE::ActionInfo::m_speed, and FIFE::ActionInfo::m_target.
| void FIFE::Instance::follow | ( | const std::string & | actionName, |
| Route * | route, | ||
| const double | speed | ||
| ) |
Performs given named action to the instance.
While performing the action follows given route with given speed. Note: In this case route isn't deleted or resetted at the end.
| actionName | name of the action |
| route | followed route |
| speed | speed used for movement. Units = distance 1 in layer coordinates per second |
Definition at line 493 of file instance.cpp.
References FIFE::_log, FL_DBG, FIFE::Layer::getCellGrid(), FIFE::Route::getEndNode(), FIFE::Location::getLayer(), FIFE::Location::getLayerCoordinates(), FIFE::Object::getMultiObjectCoordinates(), FIFE::Object::getWalkableAreas(), FIFE::Object::getZStepRange(), initializeAction(), isMultiCell(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_delete_route, m_location, m_object, m_rotation, FIFE::ActionInfo::m_route, FIFE::ActionInfo::m_speed, FIFE::ActionInfo::m_target, FIFE::Route::setObject(), and FIFE::Route::setOccupiedArea().
| uint32_t FIFE::Instance::getActionRuntime | ( | ) |
Gets the time in milliseconds how long action has been active In case there is no current action, returns -1.
Definition at line 913 of file instance.cpp.
References bindTimeProvider(), FIFE::TimeProvider::getGameTime(), getRuntime(), FIFE::ActionInfo::m_action_offset_time, FIFE::ActionInfo::m_action_start_time, FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::Instance::InstanceActivity::m_timeProvider.
Referenced by FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:
|
private |
Returns pointer to action visual, can also create it.
Definition at line 1236 of file instance.cpp.
References FIFE::Object::createAction(), createOwnObject(), FIFE::Object::getAction(), getCurrentAction(), FIFE::Object::getDefaultAction(), FIFE::Action::getVisual(), FIFE::ActionInfo::m_action, FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, m_object, and m_ownObject.
Referenced by addAnimationOverlay(), addColorOverlay(), convertToOverlays(), getAnimationOverlay(), getColorOverlay(), isAnimationOverlay(), isColorOverlay(), removeAnimationOverlay(), and removeColorOverlay().
Here is the caller graph for this function:| std::map< int32_t, AnimationPtr > FIFE::Instance::getAnimationOverlay | ( | const std::string & | actionName, |
| int32_t | angle | ||
| ) |
Gets map with animations closest to given angle.
Definition at line 1157 of file instance.cpp.
References getActionVisual(), and FIFE::ActionVisual::getAnimationOverlay().
| uint8_t FIFE::Instance::getCellStackPosition | ( | ) |
Gets the cell stack position.
Definition at line 559 of file instance.cpp.
References m_cellStackPos.
| InstanceChangeInfo FIFE::Instance::getChangeInfo | ( | ) |
Returns a bitmask of changes of the last update.
Definition at line 951 of file instance.cpp.
References FIFE::ICHANGE_NO_CHANGES, m_activity, and m_changeInfo.
Referenced by FIFE::LayerCache::updateInstance().
Here is the caller graph for this function:| OverlayColors * FIFE::Instance::getColorOverlay | ( | const std::string & | actionName, |
| uint32_t | angle | ||
| ) |
Returns closest matching color overlay for given angle and action.
Definition at line 1131 of file instance.cpp.
References getActionVisual(), and FIFE::ActionVisual::getColorOverlay().
| OverlayColors * FIFE::Instance::getColorOverlay | ( | const std::string & | actionName, |
| uint32_t | angle, | ||
| int32_t | order | ||
| ) |
Returns closest matching color overlay for given angle, order and action animation overlay.
Definition at line 1183 of file instance.cpp.
References getActionVisual(), and FIFE::ActionVisual::getColorOverlay().
| double FIFE::Instance::getCost | ( | ) |
Returns cost value.
In case there is no it returns the object cost.
Definition at line 1026 of file instance.cpp.
References FIFE::Object::getCost(), m_cost, m_object, and m_specialCost.
Referenced by FIFE::Cell::addInstance().
Here is the caller graph for this function:| std::string FIFE::Instance::getCostId | ( | ) |
Returns cost id.
In case there is no it returns the object cost id.
Definition at line 1033 of file instance.cpp.
References FIFE::Object::getCostId(), m_costId, m_object, and m_specialCost.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:| Action * FIFE::Instance::getCurrentAction | ( | ) | const |
Gets the currently active action.
This is owned by the instance's object, so don't delete it!
Definition at line 870 of file instance.cpp.
References FIFE::ActionInfo::m_action, FIFE::Instance::InstanceActivity::m_actionInfo, and m_activity.
Referenced by getActionVisual(), and FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:| Location FIFE::Instance::getFacingLocation | ( | ) |
Returns the direction where instance is heading.
Definition at line 895 of file instance.cpp.
References FIFE::getFacing(), m_location, and m_rotation.
| const std::string & FIFE::Instance::getId | ( | ) |
Get the identifier for this instance; possibly null.
Definition at line 338 of file instance.cpp.
References m_id.
| Location FIFE::Instance::getLocation | ( | ) | const |
Gets current location of instance.
Definition at line 311 of file instance.cpp.
References m_location.
Referenced by FIFE::Camera::attach(), FIFE::InstanceRenderer::renderAlreadySorted(), and FIFE::InstanceRenderer::renderUnsorted().
Here is the caller graph for this function:| Location & FIFE::Instance::getLocationRef | ( | ) |
Gets reference of current location of instance.
Definition at line 315 of file instance.cpp.
References m_location.
Referenced by FIFE::InstanceTree::addInstance(), FIFE::Layer::addInstance(), follow(), FIFE::RendererNode::getCalculatedPoint(), FIFE::Camera::getMatchingInstances(), FIFE::Trigger::move(), FIFE::Trigger::moveTo(), FIFE::CellCacheChangeListener::onInstanceCreate(), FIFE::CellCacheChangeListener::onInstanceDelete(), FIFE::InstanceDistanceSortLocation::operator()(), FIFE::InstanceDistanceSortCameraAndLocation::operator()(), processMovement(), FIFE::GridRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::InstanceRenderer::renderUnsorted(), FIFE::Camera::update(), and FIFE::LayerCache::updatePosition().
Here is the caller graph for this function:| Instance * FIFE::Instance::getMainMultiInstance | ( | ) |
Returns a pointer to the main mulit instance or Null if the instance is not part of a multi instance object.
Definition at line 575 of file instance.cpp.
References m_mainMultiInstance.
| double FIFE::Instance::getMovementSpeed | ( | ) | const |
Gets the speed in case instance is moving otherwise returns 0.
Definition at line 884 of file instance.cpp.
References FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::ActionInfo::m_speed.
| const std::vector< Instance * > & FIFE::Instance::getMultiInstances | ( | ) |
Returns a vector that contains all instances of a multi object.
Definition at line 567 of file instance.cpp.
References m_multiInstances.
Referenced by FIFE::CellCacheChangeListener::onInstanceCreate(), and FIFE::CellCacheChangeListener::onInstanceDelete().
Here is the caller graph for this function:| Object * FIFE::Instance::getObject | ( | ) |
Gets object where this instance is instantiated from.
Definition at line 292 of file instance.cpp.
References m_object.
Referenced by FIFE::Cell::addInstance(), FIFE::RenderItem::getStaticImageIndexByAngle(), FIFE::Cell::removeInstance(), FIFE::BlockingInfoRenderer::render(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::InstanceRenderer::renderUnsorted(), and FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:| Location & FIFE::Instance::getOldLocationRef | ( | ) |
Gets reference of old location of instance.
Definition at line 899 of file instance.cpp.
References m_activity, m_location, and FIFE::Instance::InstanceActivity::m_oldLocation.
Referenced by FIFE::Trigger::move(), and FIFE::Map::update().
Here is the caller graph for this function:| int32_t FIFE::Instance::getOldRotation | ( | ) | const |
Get the old rotation offset of this instance Returns direction where instance was heading.
Definition at line 906 of file instance.cpp.
References m_activity, FIFE::Instance::InstanceActivity::m_oldRotation, and m_rotation.
| int32_t FIFE::Instance::getRotation | ( | ) | const |
Get the rotation offset of this instance Returns direction where instance is heading.
Definition at line 330 of file instance.cpp.
References m_rotation.
Referenced by move(), FIFE::CellCacheChangeListener::onInstanceCreate(), FIFE::CellCacheChangeListener::onInstanceDelete(), processMovement(), and FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:| Route * FIFE::Instance::getRoute | ( | ) |
Returns a pointer to the route, in case there is no, it returns NULL.
Definition at line 521 of file instance.cpp.
References FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, and FIFE::ActionInfo::m_route.
| uint32_t FIFE::Instance::getRuntime | ( | ) |
Gets the scaled runtime in milliseconds.
Definition at line 1001 of file instance.cpp.
References bindTimeProvider(), FIFE::TimeProvider::getGameTime(), FIFE::Location::getLayer(), FIFE::Layer::getMap(), FIFE::TimeManager::getTime(), FIFE::Map::getTimeProvider(), FIFE::DynamicSingleton< TimeManager >::instance(), m_activity, m_location, and FIFE::Instance::InstanceActivity::m_timeProvider.
Referenced by getActionRuntime(), initializeAction(), and say().
Here is the caller graph for this function:| const std::string * FIFE::Instance::getSayText | ( | ) | const |
Returns pointer to currently set saytext.
In case no text is set, returns NULL
Definition at line 624 of file instance.cpp.
References m_activity, FIFE::Instance::InstanceActivity::m_sayInfo, and FIFE::SayInfo::m_txt.
Referenced by FIFE::FloatingTextRenderer::render().
Here is the caller graph for this function:| double FIFE::Instance::getSpeed | ( | ) |
Returns speed modifier.
Definition at line 1040 of file instance.cpp.
References FIFE::Object::getSpeed(), and m_object.
Referenced by FIFE::Cell::addInstance().
Here is the caller graph for this function:| OverlayColors * FIFE::Instance::getStaticColorOverlay | ( | int32_t | angle | ) |
Returns closest matching static color overlay for given angle.
Definition at line 1097 of file instance.cpp.
References FIFE::ObjectVisual::getStaticColorOverlay(), FIFE::Object::getVisual(), m_object, and m_ownObject.
| Location FIFE::Instance::getTargetLocation | ( | ) | const |
Gets movement target in case instance is moving.
In case not, returns current location To move target location, call move-method
Definition at line 877 of file instance.cpp.
References FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, m_location, and FIFE::ActionInfo::m_target.
| float FIFE::Instance::getTimeMultiplier | ( | ) |
Gets instance speed.
Definition at line 981 of file instance.cpp.
References FIFE::TimeProvider::getMultiplier(), m_activity, and FIFE::Instance::InstanceActivity::m_timeProvider.
| float FIFE::Instance::getTotalTimeMultiplier | ( | ) |
Gets instance speed, considering also model and map speeds.
Definition at line 988 of file instance.cpp.
References FIFE::Location::getLayer(), FIFE::Layer::getMap(), FIFE::Map::getTimeProvider(), FIFE::TimeProvider::getTotalMultiplier(), m_activity, m_location, and FIFE::Instance::InstanceActivity::m_timeProvider.
| uint16_t FIFE::Instance::getVisitorRadius | ( | ) |
Gets the visitor range.
Definition at line 551 of file instance.cpp.
References m_visitorRadius.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:| VisitorShapeInfo FIFE::Instance::getVisitorShape | ( | ) |
Gets the shape type for a visitor.
Definition at line 543 of file instance.cpp.
References m_visitorShape.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:
|
inline |
Gets used visualization.
Definition at line 348 of file instance.h.
References m_visual.
Referenced by FIFE::InstanceVisual::create(), FIFE::InstanceDistanceSortCamera::operator()(), FIFE::InstanceDistanceSortLocation::operator()(), FIFE::InstanceDistanceSortCameraAndLocation::operator()(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::InstanceRenderer::renderUnsorted(), and FIFE::LayerCache::updateVisual().
Here is the caller graph for this function:
|
private |
Initialize action for use.
Definition at line 415 of file instance.cpp.
References cancelAction(), FIFE::Object::getAction(), FIFE::Object::getPather(), getRuntime(), initializeChanges(), isMultiObject(), FIFE::ActionInfo::m_action, FIFE::ActionInfo::m_action_start_time, FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, m_location, m_multiInstances, m_object, and FIFE::ActionInfo::m_prev_call_time.
Referenced by actOnce(), actRepeat(), follow(), and move().
Here is the caller graph for this function:
|
private |
called when instance has been changed. Causes instance to create InstanceActivity
Definition at line 271 of file instance.cpp.
References FIFE::Location::getLayer(), m_activity, m_location, and FIFE::Layer::setInstanceActivityStatus().
Referenced by addActionListener(), addChangeListener(), initializeAction(), prepareForUpdate(), refresh(), say(), and setTimeMultiplier().
Here is the caller graph for this function:| bool FIFE::Instance::isActive | ( | ) | const |
If this returns true, the instance needs to be updated.
Definition at line 288 of file instance.cpp.
References m_activity.
Referenced by FIFE::Layer::addInstance(), FIFE::Layer::createInstance(), FIFE::Layer::deleteInstance(), prepareForUpdate(), and FIFE::Layer::removeInstance().
Here is the caller graph for this function:| bool FIFE::Instance::isAnimationOverlay | ( | const std::string & | actionName | ) |
Indicates if there exists a animation overlay for given action.
Definition at line 1200 of file instance.cpp.
References getActionVisual(), and FIFE::ActionVisual::isAnimationOverlay().
| bool FIFE::Instance::isBlocking | ( | ) | const |
Gets if instance blocks movement.
Definition at line 349 of file instance.cpp.
References m_blocking.
Referenced by FIFE::BlockingInfoRenderer::render().
Here is the caller graph for this function:| bool FIFE::Instance::isColorOverlay | ( | const std::string & | actionName | ) |
Indicates if there exists a color overlay for given action or animation overlay.
Definition at line 1208 of file instance.cpp.
References getActionVisual(), and FIFE::ActionVisual::isColorOverlay().
| bool FIFE::Instance::isMultiCell | ( | ) |
Returns true if it is multi cell otherwise false.
Definition at line 1048 of file instance.cpp.
References FIFE::Object::isMultiObject(), and m_object.
Referenced by follow(), move(), FIFE::CellCacheChangeListener::onInstanceCreate(), FIFE::CellCacheChangeListener::onInstanceDelete(), and processMovement().
Here is the caller graph for this function:| bool FIFE::Instance::isMultiObject | ( | ) |
Returns true if it is multi object otherwise false.
Definition at line 1052 of file instance.cpp.
References m_multiInstances.
Referenced by cancelAction(), finalizeAction(), initializeAction(), and onInstanceDeleted().
Here is the caller graph for this function:| bool FIFE::Instance::isOverrideBlocking | ( | ) | const |
Gets if instance blocking can overriden.
Definition at line 357 of file instance.cpp.
References m_overrideBlocking.
| bool FIFE::Instance::isSpecialCost | ( | ) |
Returns true if instance or object have special cost otherwise false.
Definition at line 563 of file instance.cpp.
References m_specialCost.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:| bool FIFE::Instance::isSpecialSpeed | ( | ) |
Returns true if instance or object have special speed modifier otherwise false.
Definition at line 1044 of file instance.cpp.
References FIFE::Object::isSpecialSpeed(), and m_object.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:| bool FIFE::Instance::isStaticColorOverlay | ( | ) |
Indicates if there exists a static color overlay.
Definition at line 1114 of file instance.cpp.
References FIFE::Object::getVisual(), FIFE::ObjectVisual::isColorOverlay(), m_object, and m_ownObject.
| bool FIFE::Instance::isVisitor | ( | ) |
If instance is a visitor it returns true otherwise false.
Definition at line 535 of file instance.cpp.
References m_isVisitor.
Referenced by FIFE::Cell::addInstance(), and FIFE::Cell::removeInstance().
Here is the caller graph for this function:| void FIFE::Instance::move | ( | const std::string & | actionName, |
| const Location & | target, | ||
| const double | speed, | ||
| const std::string & | costId = "" |
||
| ) |
Performs given named action to the instance.
While performing the action moves instance to given target with given speed
| actionName | name of the action |
| target | place where to move this instance |
| speed | speed used for movement. Units = distance 1 in layer coordinates per second |
| costid | id for special costs which is be used as extra multiplier. |
Definition at line 442 of file instance.cpp.
References FIFE::_log, FIFE::Math< T >::Equal(), finalizeAction(), FL_DBG, FIFE::Object::getAction(), FIFE::Layer::getCellGrid(), FIFE::Route::getCostId(), FIFE::Location::getLayer(), FIFE::Location::getLayerCoordinates(), FIFE::Object::getMultiObjectCoordinates(), getRotation(), FIFE::Object::getWalkableAreas(), FIFE::Object::getZStepRange(), initializeAction(), isMultiCell(), FIFE::ActionInfo::m_action, FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, m_location, m_object, FIFE::ActionInfo::m_pather, m_rotation, FIFE::ActionInfo::m_route, FIFE::ActionInfo::m_speed, FIFE::ActionInfo::m_target, FIFE::Route::setCostId(), setFacingLocation(), FIFE::Route::setObject(), FIFE::Route::setOccupiedArea(), FIFE::Route::setRotation(), and FIFE::IPather::solveRoute().
|
virtual |
callback so other instances we depend on can notify us if they go away
Implements FIFE::InstanceDeleteListener.
Definition at line 1284 of file instance.cpp.
References isMultiObject(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_leader, and m_multiInstances.
|
private |
called to prepare the instance for an update
Definition at line 280 of file instance.cpp.
References initializeChanges(), isActive(), and refresh().
Referenced by addAnimationOverlay(), addColorOverlay(), addStaticColorOverlay(), callOnStackPositionChange(), callOnTransparencyChange(), callOnVisibleChange(), removeAnimationOverlay(), removeColorOverlay(), removeStaticColorOverlay(), setBlocking(), setLocation(), and setRotation().
Here is the caller graph for this function:
|
private |
Moves instance. Returns true if finished.
Definition at line 631 of file instance.cpp.
References FIFE::Map::addInstanceForTransfer(), FIFE::IPather::followRoute(), FIFE::Layer::getCellGrid(), FIFE::Route::getCurrentNode(), FIFE::Route::getEndNode(), FIFE::TimeProvider::getGameTime(), FIFE::Location::getLayer(), FIFE::Location::getLayerCoordinates(), FIFE::Location::getLayerDistanceTo(), getLocationRef(), FIFE::Layer::getMap(), FIFE::Object::getMultiObjectCoordinates(), FIFE::Route::getPathLength(), FIFE::Route::getPreviousNode(), getRotation(), FIFE::Route::getRotation(), FIFE::Route::getRouteStatus(), FIFE::Object::getWalkableAreas(), FIFE::Object::getZStepRange(), isMultiCell(), FIFE::Route::isReplanned(), FIFE::Instance::InstanceActivity::m_actionInfo, m_activity, FIFE::ActionInfo::m_leader, m_location, m_multiInstances, m_object, FIFE::ActionInfo::m_pather, FIFE::ActionInfo::m_prev_call_time, m_rotation, FIFE::ActionInfo::m_route, FIFE::ActionInfo::m_speed, FIFE::ActionInfo::m_target, FIFE::Instance::InstanceActivity::m_timeProvider, FIFE::ROUTE_FAILED, FIFE::ROUTE_SOLVED, FIFE::Route::setEndNode(), setFacingLocation(), FIFE::Location::setLayerCoordinates(), setLocation(), FIFE::Route::setObject(), FIFE::Route::setOccupiedArea(), FIFE::Route::setReplanned(), setRotation(), FIFE::Route::setRotation(), FIFE::Route::setStartNode(), and FIFE::IPather::solveRoute().
Referenced by update().
Here is the caller graph for this function:| void FIFE::Instance::refresh | ( | ) |
Refreshes instance e.g.
in case location is updated directly (not via setLocation) In this case e.g. instance's master time provider is changed, so it needs to be updated
Definition at line 946 of file instance.cpp.
References bindTimeProvider(), and initializeChanges().
Referenced by prepareForUpdate().
Here is the caller graph for this function:| void FIFE::Instance::removeActionListener | ( | InstanceActionListener * | listener | ) |
Removes associated instance action listener.
| listener | to remove |
Definition at line 366 of file instance.cpp.
References FIFE::_log, FL_WARN, FIFE::Instance::InstanceActivity::m_actionListeners, and m_activity.
| void FIFE::Instance::removeAnimationOverlay | ( | const std::string & | actionName, |
| uint32_t | angle, | ||
| int32_t | order | ||
| ) |
Removes animation overlay with given angle (degrees) and order from action.
Definition at line 1165 of file instance.cpp.
References getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, prepareForUpdate(), and FIFE::ActionVisual::removeAnimationOverlay().
| void FIFE::Instance::removeChangeListener | ( | InstanceChangeListener * | listener | ) |
Removes associated instance change listener.
| listener | to remove |
Definition at line 400 of file instance.cpp.
References FIFE::_log, FL_WARN, m_activity, and FIFE::Instance::InstanceActivity::m_changeListeners.
Referenced by FIFE::Trigger::detach().
Here is the caller graph for this function:| void FIFE::Instance::removeColorOverlay | ( | const std::string & | actionName, |
| int32_t | angle | ||
| ) |
Removes a color overlay with given angle (degrees) from given action.
Definition at line 1139 of file instance.cpp.
References getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, prepareForUpdate(), and FIFE::ActionVisual::removeColorOverlay().
| void FIFE::Instance::removeColorOverlay | ( | const std::string & | actionName, |
| int32_t | angle, | ||
| int32_t | order | ||
| ) |
Removes a color overlay with given angle (degrees), order from given action animation overlay.
Definition at line 1191 of file instance.cpp.
References getActionVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, prepareForUpdate(), and FIFE::ActionVisual::removeColorOverlay().
| void FIFE::Instance::removeDeleteListener | ( | InstanceDeleteListener * | listener | ) |
Removes associated instance delete listener.
| listener | to remove |
Definition at line 1269 of file instance.cpp.
References FIFE::_log, FL_WARN, and m_deleteListeners.
Referenced by cancelAction(), FIFE::RendererNode::changeInstance(), FIFE::Trigger::detach(), finalizeAction(), FIFE::InstanceRenderer::removeColored(), FIFE::RendererNode::removeInstance(), FIFE::InstanceRenderer::removeInstance(), FIFE::InstanceRenderer::removeOutlined(), and FIFE::InstanceRenderer::removeTransparentArea().
Here is the caller graph for this function:| void FIFE::Instance::removeStaticColorOverlay | ( | int32_t | angle | ) |
Removes a static color overlay with given angle (degrees).
Definition at line 1105 of file instance.cpp.
References FIFE::Object::getVisual(), FIFE::ICHANGE_VISUAL, m_activity, FIFE::Instance::InstanceActivity::m_additional, m_object, m_ownObject, prepareForUpdate(), and FIFE::ObjectVisual::removeStaticColorOverlay().
| void FIFE::Instance::resetCost | ( | ) |
| void FIFE::Instance::say | ( | const std::string & | text, |
| uint32_t | duration = 0 |
||
| ) |
Causes instance to "say" given text (shown on screen next to the instance)
| text | text to say. If "" given, clear the text |
| duration | duration to show the text (in ms). If 0, shows forever |
Definition at line 613 of file instance.cpp.
References getRuntime(), initializeChanges(), m_activity, FIFE::Instance::InstanceActivity::m_sayInfo, and FIFE::SayInfo::m_start_time.
Referenced by update().
Here is the caller graph for this function:| void FIFE::Instance::setActionRuntime | ( | uint32_t | time_offset | ) |
Sets the time in milliseconds how long an action has been active This was requested in Ticket #373.
This way the state of the action can be saved and restored at a later time
| time_offset | The action time offset that should be applied |
Definition at line 922 of file instance.cpp.
References FIFE::ActionInfo::m_action_offset_time, FIFE::Instance::InstanceActivity::m_actionInfo, and m_activity.
| void FIFE::Instance::setBlocking | ( | bool | blocking | ) |
Sets if instance blocks movement.
Definition at line 342 of file instance.cpp.
References m_blocking, m_overrideBlocking, and prepareForUpdate().
| void FIFE::Instance::setCellStackPosition | ( | uint8_t | stack | ) |
Sets the cell stack position.
Definition at line 555 of file instance.cpp.
References m_cellStackPos.
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:| void FIFE::Instance::setCost | ( | const std::string & | id, |
| double | cost | ||
| ) |
Sets for the given cost id a cost.
| id | name of the cost id |
| cost | value for the cost |
Definition at line 1016 of file instance.cpp.
References m_cost, m_costId, and m_specialCost.
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:| void FIFE::Instance::setFacingLocation | ( | const Location & | loc | ) |
Sets the direction where instance is heading.
Useful e.g. with static instances which don't "move" or "act"
Definition at line 891 of file instance.cpp.
References FIFE::getAngleBetween(), m_location, and setRotation().
Referenced by actOnce(), actRepeat(), move(), and processMovement().
Here is the caller graph for this function:| void FIFE::Instance::setId | ( | const std::string & | identifier = "" | ) |
| void FIFE::Instance::setLocation | ( | const Location & | loc | ) |
Sets location of the instance.
| loc | new location |
Definition at line 296 of file instance.cpp.
References FIFE::InstanceTree::addInstance(), FIFE::Layer::getInstanceTree(), FIFE::Location::getLayer(), FIFE::Location::getLayerCoordinates(), m_location, prepareForUpdate(), and FIFE::InstanceTree::removeInstance().
Referenced by processMovement().
Here is the caller graph for this function:| void FIFE::Instance::setMainMultiInstance | ( | Instance * | main | ) |
Sets a instance to the main multi instance of this instance.
Definition at line 571 of file instance.cpp.
References m_mainMultiInstance.
Referenced by Instance().
Here is the caller graph for this function:| void FIFE::Instance::setOverrideBlocking | ( | bool | overblock | ) |
Sets if instance blocking can overriden.
Definition at line 353 of file instance.cpp.
References m_overrideBlocking.
| void FIFE::Instance::setRotation | ( | int32_t | rotation | ) |
Set the rotation offset of this instance.
Definition at line 319 of file instance.cpp.
References m_rotation, and prepareForUpdate().
Referenced by actOnce(), actRepeat(), FIFE::MapLoader::load(), processMovement(), and setFacingLocation().
Here is the caller graph for this function:| void FIFE::Instance::setTimeMultiplier | ( | float | multip | ) |
Sets speed for the map.
Definition at line 973 of file instance.cpp.
References bindTimeProvider(), initializeChanges(), m_activity, FIFE::Instance::InstanceActivity::m_timeProvider, and FIFE::TimeProvider::setMultiplier().
| void FIFE::Instance::setVisitor | ( | bool | visit | ) |
Marks this instance as a visitor.
Definition at line 531 of file instance.cpp.
References m_isVisitor.
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:| void FIFE::Instance::setVisitorRadius | ( | uint16_t | radius | ) |
Sets the range for a visitor.
Definition at line 547 of file instance.cpp.
References m_visitorRadius.
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:| void FIFE::Instance::setVisitorShape | ( | VisitorShapeInfo | info | ) |
Sets the shape type for a visitor.
Definition at line 539 of file instance.cpp.
References m_visitorShape.
Referenced by FIFE::MapLoader::load().
Here is the caller graph for this function:
|
inline |
Sets visualization to be used.
Transfers ownership.
Definition at line 344 of file instance.h.
References m_visual.
Referenced by FIFE::InstanceVisual::create().
Here is the caller graph for this function:| InstanceChangeInfo FIFE::Instance::update | ( | ) |
Updates the instance related to the current action.
Definition at line 744 of file instance.cpp.
References bindTimeProvider(), finalizeAction(), FIFE::Action::getDuration(), FIFE::TimeProvider::getGameTime(), FIFE::ICHANGE_NO_CHANGES, FIFE::Object::isMultiPart(), FIFE::ActionInfo::m_action, FIFE::ActionInfo::m_action_offset_time, FIFE::ActionInfo::m_action_start_time, FIFE::Instance::InstanceActivity::m_actionInfo, FIFE::Instance::InstanceActivity::m_actionListeners, m_activity, m_changeInfo, FIFE::Instance::InstanceActivity::m_changeListeners, m_deleteListeners, FIFE::SayInfo::m_duration, m_object, FIFE::ActionInfo::m_prev_call_time, FIFE::ActionInfo::m_repeating, FIFE::Instance::InstanceActivity::m_sayInfo, FIFE::SayInfo::m_start_time, FIFE::ActionInfo::m_target, FIFE::Instance::InstanceActivity::m_timeProvider, processMovement(), say(), and FIFE::Instance::InstanceActivity::update().
Referenced by FIFE::Layer::deleteInstance(), and FIFE::Layer::removeInstance().
Here is the caller graph for this function:| void FIFE::Instance::updateMultiInstances | ( | ) |
Updates the visual positions of all instances in case this is a multi object.
Definition at line 1056 of file instance.cpp.
References FIFE::Math< T >::Cos(), FIFE::Location::getMapCoordinates(), FIFE::Object::getRestrictedRotation(), FIFE::Object::getRotationAnchor(), FIFE::Object::isRestrictedRotation(), m_location, m_multiInstances, m_object, m_rotation, FIFE::Math< T >::pi(), FIFE::Location::setExactLayerCoordinates(), FIFE::Location::setLayerCoordinates(), FIFE::Location::setMapCoordinates(), FIFE::Math< T >::Sin(), FIFE::PointType3D< T >::x, and FIFE::PointType3D< T >::y.
Referenced by FIFE::CellCacheChangeListener::onInstanceCreate(), and FIFE::CellCacheChangeListener::onInstanceDelete().
Here is the caller graph for this function:
|
private |
Definition at line 598 of file instance.h.
Referenced by actOnce(), actRepeat(), addActionListener(), addAnimationOverlay(), addChangeListener(), addColorOverlay(), addStaticColorOverlay(), bindTimeProvider(), callOnActionFrame(), callOnStackPositionChange(), callOnTransparencyChange(), callOnVisibleChange(), cancelAction(), cancelMovement(), finalizeAction(), follow(), getActionRuntime(), getActionVisual(), getChangeInfo(), getCurrentAction(), getMovementSpeed(), getOldLocationRef(), getOldRotation(), getRoute(), getRuntime(), getSayText(), getTargetLocation(), getTimeMultiplier(), getTotalTimeMultiplier(), initializeAction(), initializeChanges(), isActive(), move(), onInstanceDeleted(), processMovement(), removeActionListener(), removeAnimationOverlay(), removeChangeListener(), removeColorOverlay(), removeStaticColorOverlay(), say(), setActionRuntime(), setTimeMultiplier(), update(), and ~Instance().
|
private |
instance blocking info
Definition at line 613 of file instance.h.
Referenced by isBlocking(), setBlocking(), and FIFE::Instance::InstanceActivity::update().
|
private |
position on cell stack
Definition at line 623 of file instance.h.
Referenced by getCellStackPosition(), and setCellStackPosition().
|
private |
bitmask stating current changes
Definition at line 600 of file instance.h.
Referenced by getChangeInfo(), update(), and FIFE::Instance::InstanceActivity::update().
|
private |
|
private |
|
private |
listeners for deletion of the instance
Definition at line 602 of file instance.h.
Referenced by addDeleteListener(), removeDeleteListener(), update(), and ~Instance().
|
private |
Definition at line 543 of file instance.h.
|
private |
is instance a visitor (FoW)
Definition at line 617 of file instance.h.
Referenced by isVisitor(), and setVisitor().
|
private |
current location
Definition at line 609 of file instance.h.
Referenced by bindTimeProvider(), follow(), getFacingLocation(), getLocation(), getLocationRef(), getOldLocationRef(), getRuntime(), getTargetLocation(), getTotalTimeMultiplier(), initializeAction(), initializeChanges(), Instance(), move(), processMovement(), setFacingLocation(), setLocation(), FIFE::Instance::InstanceActivity::update(), and updateMultiInstances().
|
private |
pointer to the main multi instance
Definition at line 633 of file instance.h.
Referenced by getMainMultiInstance(), Instance(), and setMainMultiInstance().
|
private |
vector that holds all multi instances
Definition at line 631 of file instance.h.
Referenced by cancelAction(), finalizeAction(), getMultiInstances(), initializeAction(), Instance(), isMultiObject(), onInstanceDeleted(), processMovement(), updateMultiInstances(), and ~Instance().
|
private |
object where instantiated from
Definition at line 605 of file instance.h.
Referenced by addStaticColorOverlay(), createOwnObject(), follow(), getActionVisual(), getCost(), getCostId(), getObject(), getSpeed(), getStaticColorOverlay(), initializeAction(), Instance(), isMultiCell(), isSpecialSpeed(), isStaticColorOverlay(), move(), processMovement(), removeStaticColorOverlay(), update(), updateMultiInstances(), and ~Instance().
|
private |
allow to override the blocking property
Definition at line 615 of file instance.h.
Referenced by isOverrideBlocking(), setBlocking(), and setOverrideBlocking().
|
private |
indicates if m_object is customized
Definition at line 607 of file instance.h.
Referenced by addStaticColorOverlay(), createOwnObject(), getActionVisual(), getStaticColorOverlay(), isStaticColorOverlay(), removeStaticColorOverlay(), and ~Instance().
|
private |
The rotation offset of this instance.
This is in addition to possible camera rotation and intended for setting, for example, a rotation of a tile.
Definition at line 547 of file instance.h.
Referenced by follow(), getFacingLocation(), getOldRotation(), getRotation(), Instance(), move(), processMovement(), setRotation(), FIFE::Instance::InstanceActivity::update(), and updateMultiInstances().
|
private |
indicates special cost
Definition at line 625 of file instance.h.
Referenced by getCost(), getCostId(), isSpecialCost(), resetCost(), and setCost().
|
private |
visitor radius (FoW)
Definition at line 621 of file instance.h.
Referenced by getVisitorRadius(), and setVisitorRadius().
|
private |
visitor shape type
Definition at line 619 of file instance.h.
Referenced by getVisitorShape(), and setVisitorShape().
|
private |
instance visualization
Definition at line 611 of file instance.h.
Referenced by getVisual(), setVisual(), and ~Instance().