ScummVM API documentation
Stark::Resources::Command Class Reference

#include <command.h>

Inheritance diagram for Stark::Resources::Command:
Stark::Resources::Object

Classes

struct  Argument
 

Public Types

enum  SubType {
  kCommandBegin = 0, kCommandEnd = 1, kScriptCall = 2, kDialogCall = 3,
  kSetInteractiveMode = 4, kLocationGoTo = 5, kWalkTo = 7, kGameLoop = 8,
  kScriptPause = 9, kScriptPauseRandom = 10, kScriptPauseSkippable = 11, kScriptAbort = 13,
  kExit2DLocation = 16, kGoto2DLocation = 17, kRumbleScene = 19, kFadeScene = 20,
  kSwayScene = 21, kLocationGoToNewCD = 22, kGameEnd = 23, kInventoryOpen = 24,
  kFloatScene = 25, kBookOfSecretsOpen = 26, kDoNothing = 80, kItem3DPlaceOn = 81,
  kItem3DWalkTo = 82, kItem3DFollowPath = 83, kItemLookAt = 84, kItem2DFollowPath = 86,
  kItemEnable = 87, kItemSetActivity = 88, kItemSelectInInventory = 89, kUseAnimHierarchy = 92,
  kPlayAnimation = 93, kScriptEnable = 94, kShowPlay = 95, kKnowledgeSetBoolean = 96,
  kKnowledgeSetInteger = 100, kKnowledgeAddInteger = 101, kEnableFloorField = 103, kPlayAnimScriptItem = 104,
  kItemAnimFollowPath = 105, kKnowledgeAssignBool = 107, kKnowledgeAssignInteger = 110, kLocationScrollTo = 111,
  kSoundPlay = 112, kKnowledgeSetIntRandom = 115, kKnowledgeSubValue = 117, kItemLookDirection = 118,
  kStopPlayingSound = 119, kLayerGoTo = 120, kLayerEnable = 121, kLocationScrollSet = 122,
  kFullMotionVideoPlay = 123, kAnimSetFrame = 125, kKnowledgeAssignNegatedBool = 126, kDiaryEnableEntry = 127,
  kPATChangeTooltip = 128, kSoundChange = 129, kLightSetColor = 130, kLightFollowPath = 131,
  kItem3DRunTo = 132, kItemPlaceDirection = 133, kItemRotateDirection = 134, kActivateTexture = 135,
  kActivateMesh = 136, kItem3DSetWalkTarget = 137, kSpeakWithoutTalking = 139, kIsOnFloorField = 162,
  kIsItemEnabled = 163, kIsScriptEnabled = 165, kIsKnowledgeBooleanSet = 166, kIsKnowledgeIntegerInRange = 170,
  kIsKnowledgeIntegerAbove = 171, kIsKnowledgeIntegerEqual = 172, kIsKnowledgeIntegerLower = 173, kIsScriptActive = 174,
  kIsRandom = 175, kIsAnimScriptItemReached = 176, kIsItemOnPlace = 177, kIsAnimPlaying = 179,
  kIsItemActivity = 180, kIsItemNearPlace = 183, kIsAnimAtTime = 185, kIsLocation2D = 186,
  kIsInventoryOpen = 187
}
 

Public Member Functions

 Command (Object *parent, byte subType, uint16 index, const Common::String &name)
 
Commandexecute (uint32 callMode, Script *script)
 
CommandnextCommand ()
 
CommandnextCommandIf (bool predicate)
 
Common::Array< ArgumentgetArguments () const
 
void resumeItemSetActivity ()
 
- 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 saveLoad (ResourceSerializer *serializer)
 
virtual void saveLoadCurrent (ResourceSerializer *serializer)
 
virtual void onPostRead ()
 
virtual void onAllLoaded ()
 
virtual void onEnterLocation ()
 
virtual void onGameLoop ()
 
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 Attributes

static const Type::ResourceType TYPE = Type::kCommand
 

Protected Member Functions

void readData (Formats::XRCReadStream *stream) override
 
CommandresolveArgumentSiblingReference (const Argument &argument)
 
Math::Vector3d getObjectPosition (const ResourceReference &targetRef, int32 *floorFace=nullptr)
 
CommandopScriptBegin ()
 
CommandopScriptCall (Script *script, const ResourceReference &scriptRef, int32 synchronous)
 
CommandopDialogCall (Script *script, const ResourceReference &dialogRef, int32 suspend)
 
CommandopSetInteractiveMode (bool enabled)
 
CommandopLocationGoTo (const Common::String &level, const Common::String &location, const ResourceReference &bookmarkRef, int32 direction)
 
CommandopWalkTo (Script *script, const ResourceReference &objectRef, int32 suspend)
 
CommandopScriptPauseGameLoop (Script *script, int32 count)
 
CommandopScriptPause (Script *script, const ResourceReference &durationRef)
 
CommandopScriptPauseRandom (Script *script, const ResourceReference &itemRef)
 
CommandopScriptPauseSkippable (Script *script, const ResourceReference &durationRef)
 
CommandopScriptAbort (ResourceReference scriptRef, bool disable)
 
CommandopExit2DLocation ()
 
CommandopGoto2DLocation (const Common::String &level, const Common::String &location)
 
CommandopRumbleScene (Script *script, int32 rumbleDuration, int32 pause)
 
CommandopFadeScene (Script *script, bool fadeOut, int32 fadeDuration, bool pause)
 
CommandopSwayScene (int32 periodMs, int32 angleIn, int32 amplitudeIn, int32 offsetIn)
 
CommandopGameEnd ()
 
CommandopInventoryOpen (bool open)
 
CommandopFloatScene (int32 periodMs, int32 amplitudeIn, int32 offsetIn)
 
CommandopBookOfSecretsOpen ()
 
CommandopDoNothing ()
 
CommandopItem3DPlaceOn (const ResourceReference &itemRef, const ResourceReference &targetRef)
 
CommandopItem3DWalkTo (Script *script, const ResourceReference &itemRef, const ResourceReference &targetRef, bool suspend)
 
CommandopItemFollowPath (Script *script, ResourceReference itemRef, ResourceReference pathRef, uint32 speed, uint32 suspend)
 
CommandopItemLookAt (Script *script, const ResourceReference &itemRef, const ResourceReference &objRef, bool suspend, int32 unknown)
 
CommandopItemEnable (const ResourceReference &itemRef, int32 enable)
 
CommandopItemSetActivity (Script *script, const ResourceReference &itemRef, int32 animActivity, bool wait)
 
CommandopItemSelectInInventory (const ResourceReference &itemRef)
 
CommandopUseAnimHierachy (const ResourceReference &animHierRef)
 
CommandopPlayAnimation (Script *script, const ResourceReference &animRef, bool suspend)
 
CommandopScriptEnable (const ResourceReference &scriptRef, int32 enable)
 
CommandopShowPlay (Script *script, const ResourceReference &ref, int32 suspend)
 
CommandopKnowledgeSetBoolean (const ResourceReference &knowledgeRef, int32 enable)
 
CommandopKnowledgeSetInteger (const ResourceReference &knowledgeRef, int32 value)
 
CommandopKnowledgeSetIntRandom (const ResourceReference &knowledgeRef, uint32 min, uint32 max)
 
CommandopKnowledgeAddInteger (const ResourceReference &knowledgeRef, int32 increment)
 
CommandopKnowledgeSubValue (const ResourceReference &knowledgeRef, const ResourceReference &valueRef)
 
CommandopEnableFloorField (const ResourceReference &floorFieldRef, bool enable)
 
CommandopPlayAnimScriptItem (Script *script, const ResourceReference &animScriptItemRef, int32 suspend)
 
CommandopItemAnimFollowPath (Script *script, const ResourceReference &animRef, const ResourceReference &pathRef, int32 speed, bool suspend)
 
CommandopKnowledgeAssignBool (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
CommandopKnowledgeAssignNegatedBool (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
CommandopKnowledgeAssignInteger (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
CommandopLocationScrollTo (Script *script, const ResourceReference &scrollRef, bool suspend)
 
CommandopSoundPlay (Script *script, const ResourceReference &soundRef, int32 suspend)
 
CommandopItemLookDirection (Script *script, const ResourceReference &itemRef, int32 direction, bool suspend)
 
CommandopStopPlayingSound (const ResourceReference &soundRef)
 
CommandopLayerGoTo (const ResourceReference &layerRef)
 
CommandopLayerEnable (const ResourceReference &layerRef, int32 enable)
 
CommandopLocationScrollSet (const ResourceReference &scrollRef)
 
CommandopFullMotionVideoPlay (Script *script, const ResourceReference &movieRef, int32 unknown)
 
CommandopAnimSetFrame (const ResourceReference &animRef, const ResourceReference &knowledgeRef)
 
CommandopDiaryEnableEntry (const ResourceReference &knowledgeRef)
 
CommandopPATChangeTooltip (const ResourceReference &patRef, const ResourceReference &stringRef)
 
CommandopSoundChange (Script *script, const ResourceReference &soundRef, int32 volume, int32 pan, int32 duration, bool pause)
 
CommandopLightSetColor (const ResourceReference &lightRef, int32 red, int32 green, int32 blue)
 
CommandopLightFollowPath (Script *script, const ResourceReference &itemRef, const ResourceReference &lightRef, const ResourceReference &pathRef, int32 speed, bool suspend)
 
CommandopItem3DRunTo (Script *script, const ResourceReference &itemRef, const ResourceReference &targetRef, int32 suspend)
 
CommandopItemPlaceDirection (const ResourceReference &itemRef, int32 direction)
 
CommandopItemRotateDirection (Script *script, const ResourceReference &itemRef, int32 direction, int32 speed, bool suspend)
 
CommandopActivateTexture (const ResourceReference &textureRef)
 
CommandopActivateMesh (const ResourceReference &meshRef)
 
CommandopItem3DSetWalkTarget (const ResourceReference &itemRef, const ResourceReference &targetRef)
 
CommandopSpeakWithoutTalking (Script *script, const ResourceReference &speechRef, int32 unknown)
 
CommandopIsOnFloorField (const ResourceReference &itemRef, const ResourceReference &floorFieldRef)
 
CommandopIsItemEnabled (const ResourceReference &itemRef)
 
CommandopIsScriptEnabled (const ResourceReference &scriptRef)
 
CommandopIsKnowledgeBooleanSet (const ResourceReference &knowledgeRef)
 
CommandopIsKnowledgeIntegerInRange (const ResourceReference &knowledgeRef, int32 min, int32 max)
 
CommandopIsKnowledgeIntegerAbove (const ResourceReference &knowledgeRef, int32 value)
 
CommandopIsKnowledgeIntegerEqual (const ResourceReference &knowledgeRef, int32 value)
 
CommandopIsKnowledgeIntegerLower (const ResourceReference &knowledgeRef, int32 value)
 
CommandopIsScriptActive (const ResourceReference &scriptRef)
 
CommandopIsRandom (int32 chance)
 
CommandopIsAnimScriptItemReached (const ResourceReference &animScriptItemRef)
 
CommandopIsItemNearPlace (const ResourceReference &itemRef, const ResourceReference &positionRef, int32 testDistance)
 
CommandopIsItemOnPlace (const ResourceReference &itemRef, const ResourceReference &positionRef)
 
CommandopIsAnimPlaying (const ResourceReference &animRef)
 
CommandopIsItemActivity (const ResourceReference &itemRef, int32 value)
 
CommandopIsAnimAtTime (const ResourceReference &animRef, int32 time)
 
CommandopIsLocation2D ()
 
CommandopIsInventoryOpen ()
 
- 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
 
virtual void printData ()
 

Protected Attributes

Common::Array< Argument_arguments
 
- Protected Attributes inherited from Stark::Resources::Object
Type _type
 
byte _subType
 
uint16 _index
 
Common::String _name
 
Object_parent
 
Common::Array< Object * > _children
 

Additional Inherited Members

- Static Public Member Functions inherited from Stark::Resources::Object
template<class T >
static T * cast (Object *resource)
 

Detailed Description

Command resources are script operations.

The operation code is the resource subtype.

The operation arguments can be integers, strings or resource references.

Member Function Documentation

◆ execute()

Command* Stark::Resources::Command::execute ( uint32  callMode,
Script script 
)

Execute the command

◆ nextCommand()

Command* Stark::Resources::Command::nextCommand ( )

Obtain the next command to be executed

◆ nextCommandIf()

Command* Stark::Resources::Command::nextCommandIf ( bool  predicate)

Obtain the next command to be executed, depending on a predicate

◆ getArguments()

Common::Array<Argument> Stark::Resources::Command::getArguments ( ) const

Get the command's list of arguments

◆ resumeItemSetActivity()

void Stark::Resources::Command::resumeItemSetActivity ( )

Resume the opcode ItemSetActivity after it has stopped waiting for the action anim to complete

◆ readData()

void Stark::Resources::Command::readData ( Formats::XRCReadStream stream)
overrideprotectedvirtual

Deserialize the resource static data and initial state.

Reimplemented from Stark::Resources::Object.


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