#include <item.h>
Public Member Functions | |
| Item (Object *parent, byte subType, uint16 index, const Common::String &name) | |
| void | readData (Formats::XRCReadStream *stream) override |
| void | onGameLoop () override |
| void | saveLoad (ResourceSerializer *serializer) override |
| void | saveLoadCurrent (ResourceSerializer *serializer) override |
| bool | isEnabled () const |
| virtual void | setEnabled (bool enabled) |
| int32 | getCharacterIndex () const |
| virtual Gfx::RenderEntry * | getRenderEntry (const Common::Point &positionOffset) |
| virtual ItemVisual * | getSceneInstance ()=0 |
| void | setMovement (Movement *movement) |
| Movement * | getMovement () const |
| void | setMovementSuspendedScript (Script *script) |
| virtual void | setAnimHierarchy (AnimHierarchy *animHierarchy)=0 |
| virtual Common::Array< Common::Point > | listExitPositions () |
Public Member Functions inherited from Stark::Resources::Object | |
| Type | getType () const |
| byte | getSubType () const |
| uint16 | getIndex () const |
| Common::String | getIndexAsString () const |
| Common::String | getName () const |
| virtual void | onPostRead () |
| virtual void | onAllLoaded () |
| virtual void | onEnterLocation () |
| virtual void | onEnginePause (bool pause) |
| virtual void | onExitLocation () |
| virtual void | onPreDestroy () |
| template<class T > | |
| T * | findParent () |
| Object * | findChildWithIndex (Type type, uint16 index, int subType=-1) const |
| Object * | findChildWithOrder (Type type, uint16 order, int subType=-1) const |
| Object * | findChildWithName (Type type, const Common::String &name, int subType=-1) const |
| template<class T > | |
| T * | findChild (bool mustBeUnique=true) const |
| template<class T > | |
| T * | findChildWithSubtype (int subType, bool mustBeUnique=true) const |
| template<class T > | |
| T * | findChildWithIndex (uint16 index, int subType=-1) const |
| template<class T > | |
| T * | findChildWithOrder (uint16 order, int subType=-1) const |
| template<class T > | |
| T * | findChildWithName (const Common::String &name, int subType=-1) const |
| template<class T > | |
| Common::Array< T * > | listChildren (int subType=-1) const |
| template<class T > | |
| Common::Array< T * > | listChildrenRecursive (int subType=-1) |
| void | addChild (Object *child) |
| virtual void | print (uint depth=0) |
| template<> | |
| Object * | cast (Object *resource) |
| template<> | |
| Object * | findParent () |
| template<> | |
| Common::Array< Object * > | listChildren (int subType) const |
Static Public Member Functions | |
| static Object * | construct (Object *parent, byte subType, uint16 index, const Common::String &name) |
Static Public Member Functions inherited from Stark::Resources::Object | |
| template<class T > | |
| static T * | cast (Object *resource) |
Static Public Attributes | |
| static const Type::ResourceType | TYPE = Type::kItem |
Protected Member Functions | |
| void | printData () override |
Protected Member Functions inherited from Stark::Resources::Object | |
| Object (Object *parent, byte subType, uint16 index, const Common::String &name) | |
| void | printWithDepth (uint depth, const Common::String &string) const |
| void | printDescription (uint depth) const |
Protected Attributes | |
| bool | _enabled |
| int32 | _characterIndex |
| Movement * | _movement |
| Script * | _movementSuspendedScript |
Protected Attributes inherited from Stark::Resources::Object | |
| Type | _type |
| byte | _subType |
| uint16 | _index |
| Common::String | _name |
| Object * | _parent |
| Common::Array< Object * > | _children |
A scene element
Can be a character, background, animation, ...
|
static |
Item factory
|
overridevirtual |
Deserialize the resource static data and initial state.
Reimplemented from Stark::Resources::Object.
Reimplemented in Stark::Resources::ImageItem, Stark::Resources::ModelItem, Stark::Resources::FloorPositionedImageItem, Stark::Resources::LevelItemTemplate, and Stark::Resources::ItemVisual.
|
overridevirtual |
Called once per game loop
Reimplemented from Stark::Resources::Object.
|
overridevirtual |
Persist / restore the resource state
Reimplemented from Stark::Resources::Object.
Reimplemented in Stark::Resources::FloorPositionedItem, and Stark::Resources::ItemVisual.
|
overridevirtual |
Persist / restore the resource state
Called only for active locations
Reimplemented from Stark::Resources::Object.
Reimplemented in Stark::Resources::ModelItem, Stark::Resources::ItemTemplate, and Stark::Resources::ItemVisual.
| bool Stark::Resources::Item::isEnabled | ( | ) | const |
Is the item present in the scene
|
virtual |
Enable or disable the item
Reimplemented in Stark::Resources::InventoryItem, and Stark::Resources::ItemVisual.
| int32 Stark::Resources::Item::getCharacterIndex | ( | ) | const |
Get the item's character index
|
virtual |
Obtain the render entry to use to display the item
Reimplemented in Stark::Resources::ImageItem, Stark::Resources::ModelItem, Stark::Resources::FloorPositionedImageItem, and Stark::Resources::InventoryItem.
|
pure virtual |
Obtain the concrete instance of an item template
Implemented in Stark::Resources::ItemTemplate, and Stark::Resources::ItemVisual.
| void Stark::Resources::Item::setMovement | ( | Movement * | movement | ) |
Replace the current movement with an other
| Movement* Stark::Resources::Item::getMovement | ( | ) | const |
Get the current movement if any
| void Stark::Resources::Item::setMovementSuspendedScript | ( | Script * | script | ) |
Set the script waiting for the item's movement to complete.
This script will be updated with the outcome of the movement (completion or abortion)
|
pure virtual |
Set the currently active anim hierarchy
Implemented in Stark::Resources::ItemTemplate, and Stark::Resources::ItemVisual.
|
virtual |
List all the exit positions
Reimplemented in Stark::Resources::ImageItem, and Stark::Resources::FloorPositionedImageItem.