ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

A scene element. More...

#include <item.h>

Inheritance diagram for Stark::Resources::Item:
Collaboration diagram for Stark::Resources::Item:

List of all members.

Public Types

enum  SubType {
  kItemGlobalTemplate = 1, kItemInventory = 2, kItemLevelTemplate = 3, kItemStaticProp = 5,
  kItemAnimatedProp = 6, kItemBackgroundElement = 7, kItemBackground = 8, kItemModel = 10
}

Public Member Functions

 Item (Object *parent, byte subType, uint16 index, const Common::String &name)
virtual ~Item ()
virtual void readData (Formats::XRCReadStream *stream) override
 Deserialize the resource static data and initial state.
virtual void onGameLoop () override
 Called once per game loop.
virtual void saveLoad (ResourceSerializer *serializer) override
 Persist / restore the resource state.
virtual void saveLoadCurrent (ResourceSerializer *serializer) override
 Persist / restore the resource state.
bool isEnabled () const
 Is the item present in the scene.
virtual void setEnabled (bool enabled)
 Enable or disable the item.
int32 getCharacterIndex () const
 Get the item's character index.
virtual Gfx::RenderEntrygetRenderEntry (const Common::Point &positionOffset)
 Obtain the render entry to use to display the item.
virtual ItemVisualgetSceneInstance ()=0
 Obtain the concrete instance of an item template.
void setMovement (Movement *movement)
 Replace the current movement with an other.
MovementgetMovement () const
 Get the current movement if any.
void setMovementSuspendedScript (Script *script)
 Set the script waiting for the item's movement to complete.
virtual void setAnimHierarchy (AnimHierarchy *animHierarchy)=0
 Set the currently active anim hierachy.
virtual Common::Array
< Common::Point
listExitPositions ()
 List all the exit positions.

Static Public Member Functions

static Objectconstruct (Object *parent, byte subType, uint16 index, const Common::String &name)
 Item factory.

Static Public Attributes

static const Type::ResourceType TYPE = Type::kItem

Protected Member Functions

void printData () override

Protected Attributes

bool _enabled
int32 _characterIndex
Movement_movement
Script_movementSuspendedScript

Detailed Description

A scene element.

Can be a character, background, animation, ...

Definition at line 62 of file item.h.


Member Enumeration Documentation

Enumerator:
kItemGlobalTemplate 
kItemInventory 
kItemLevelTemplate 
kItemStaticProp 
kItemAnimatedProp 
kItemBackgroundElement 
kItemBackground 
kItemModel 

Definition at line 66 of file item.h.


Constructor & Destructor Documentation

Stark::Resources::Item::Item ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
)

Definition at line 72 of file item.cpp.

Stark::Resources::Item::~Item (  )  [virtual]

Definition at line 81 of file item.cpp.


Member Function Documentation

Object * Stark::Resources::Item::construct ( Object parent,
byte  subType,
uint16  index,
const Common::String name 
) [static]

Item factory.

Definition at line 51 of file item.cpp.

int32 Stark::Resources::Item::getCharacterIndex (  )  const

Get the item's character index.

Definition at line 114 of file item.cpp.

Movement * Stark::Resources::Item::getMovement (  )  const

Get the current movement if any.

Definition at line 122 of file item.cpp.

Gfx::RenderEntry * Stark::Resources::Item::getRenderEntry ( const Common::Point positionOffset  )  [virtual]

Obtain the render entry to use to display the item.

Reimplemented in Stark::Resources::InventoryItem, Stark::Resources::FloorPositionedImageItem, Stark::Resources::ModelItem, and Stark::Resources::ImageItem.

Definition at line 118 of file item.cpp.

virtual ItemVisual* Stark::Resources::Item::getSceneInstance (  )  [pure virtual]

Obtain the concrete instance of an item template.

Implemented in Stark::Resources::ItemVisual, and Stark::Resources::ItemTemplate.

bool Stark::Resources::Item::isEnabled (  )  const

Is the item present in the scene.

Definition at line 102 of file item.cpp.

Common::Array< Common::Point > Stark::Resources::Item::listExitPositions (  )  [virtual]

List all the exit positions.

Reimplemented in Stark::Resources::FloorPositionedImageItem, and Stark::Resources::ImageItem.

Definition at line 178 of file item.cpp.

void Stark::Resources::Item::onGameLoop (  )  [override, virtual]

Called once per game loop.

Reimplemented from Stark::Resources::Object.

Definition at line 90 of file item.cpp.

void Stark::Resources::Item::printData (  )  [override, protected, virtual]
void Stark::Resources::Item::readData ( Formats::XRCReadStream stream  )  [override, virtual]

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.

Reimplemented in Stark::Resources::ItemVisual, Stark::Resources::LevelItemTemplate, Stark::Resources::FloorPositionedImageItem, Stark::Resources::ModelItem, and Stark::Resources::ImageItem.

Definition at line 85 of file item.cpp.

void Stark::Resources::Item::saveLoad ( ResourceSerializer serializer  )  [override, virtual]

Persist / restore the resource state.

Reimplemented from Stark::Resources::Object.

Reimplemented in Stark::Resources::ItemVisual, and Stark::Resources::FloorPositionedItem.

Definition at line 153 of file item.cpp.

void Stark::Resources::Item::saveLoadCurrent ( ResourceSerializer serializer  )  [override, virtual]

Persist / restore the resource state.

Called only for active locations

Reimplemented from Stark::Resources::Object.

Reimplemented in Stark::Resources::ItemVisual, Stark::Resources::ItemTemplate, and Stark::Resources::ModelItem.

Definition at line 157 of file item.cpp.

virtual void Stark::Resources::Item::setAnimHierarchy ( AnimHierarchy animHierarchy  )  [pure virtual]

Set the currently active anim hierachy.

Implemented in Stark::Resources::ItemVisual, and Stark::Resources::ItemTemplate.

void Stark::Resources::Item::setEnabled ( bool  enabled  )  [virtual]

Enable or disable the item.

Reimplemented in Stark::Resources::ItemVisual, and Stark::Resources::InventoryItem.

Definition at line 106 of file item.cpp.

void Stark::Resources::Item::setMovement ( Movement movement  ) 

Replace the current movement with an other.

Definition at line 126 of file item.cpp.

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)

Definition at line 144 of file item.cpp.


Member Data Documentation

Definition at line 128 of file item.h.

Definition at line 127 of file item.h.

Definition at line 130 of file item.h.

Definition at line 131 of file item.h.

const Type::ResourceType Stark::Resources::Item::TYPE = Type::kItem [static]

Definition at line 64 of file item.h.


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


Generated on Sat Jan 19 2019 05:07:54 for ResidualVM by doxygen 1.7.1
curved edge   curved edge