ScummVM API documentation
Stark::Resources::Item Class Referenceabstract

#include <item.h>

Inheritance diagram for Stark::Resources::Item:
Stark::Resources::Object Stark::Resources::ItemTemplate Stark::Resources::ItemVisual Stark::Resources::GlobalItemTemplate Stark::Resources::LevelItemTemplate Stark::Resources::FloorPositionedItem Stark::Resources::ImageItem Stark::Resources::InventoryItem Stark::Resources::FloorPositionedImageItem Stark::Resources::ModelItem

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)
 
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::RenderEntrygetRenderEntry (const Common::Point &positionOffset)
 
virtual ItemVisualgetSceneInstance ()=0
 
void setMovement (Movement *movement)
 
MovementgetMovement () const
 
void setMovementSuspendedScript (Script *script)
 
virtual void setAnimHierarchy (AnimHierarchy *animHierarchy)=0
 
virtual Common::Array< Common::PointlistExitPositions ()
 
- 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 ()
 
ObjectfindChildWithIndex (Type type, uint16 index, int subType=-1) const
 
ObjectfindChildWithOrder (Type type, uint16 order, int subType=-1) const
 
ObjectfindChildWithName (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<>
Objectcast (Object *resource)
 
template<>
ObjectfindParent ()
 
template<>
Common::Array< Object * > listChildren (int subType) const
 

Static Public Member Functions

static Objectconstruct (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
 

Detailed Description

A scene element

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

Member Function Documentation

◆ construct()

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

Item factory

◆ readData()

void Stark::Resources::Item::readData ( Formats::XRCReadStream stream)
overridevirtual

◆ onGameLoop()

void Stark::Resources::Item::onGameLoop ( )
overridevirtual

Called once per game loop

Reimplemented from Stark::Resources::Object.

◆ saveLoad()

void Stark::Resources::Item::saveLoad ( ResourceSerializer serializer)
overridevirtual

Persist / restore the resource state

Reimplemented from Stark::Resources::Object.

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

◆ saveLoadCurrent()

void Stark::Resources::Item::saveLoadCurrent ( ResourceSerializer serializer)
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.

◆ isEnabled()

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

Is the item present in the scene

◆ setEnabled()

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

Enable or disable the item

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

◆ getCharacterIndex()

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

Get the item's character index

◆ getRenderEntry()

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

◆ getSceneInstance()

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

Obtain the concrete instance of an item template

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

◆ setMovement()

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

Replace the current movement with an other

◆ getMovement()

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

Get the current movement if any

◆ setMovementSuspendedScript()

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)

◆ setAnimHierarchy()

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

Set the currently active anim hierarchy

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

◆ listExitPositions()

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

List all the exit positions

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


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