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)
 
Command * execute (uint32 callMode, Script *script)
 
Command * nextCommand ()
 
Command * nextCommandIf (bool predicate)
 
Common::Array< Argument > getArguments () 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 ()
 
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 Attributes

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

Protected Member Functions

void readData (Formats::XRCReadStream *stream) override
 
Command * resolveArgumentSiblingReference (const Argument &argument)
 
Math::Vector3d getObjectPosition (const ResourceReference &targetRef, int32 *floorFace=nullptr)
 
Command * opScriptBegin ()
 
Command * opScriptCall (Script *script, const ResourceReference &scriptRef, int32 synchronous)
 
Command * opDialogCall (Script *script, const ResourceReference &dialogRef, int32 suspend)
 
Command * opSetInteractiveMode (bool enabled)
 
Command * opLocationGoTo (const Common::String &level, const Common::String &location, const ResourceReference &bookmarkRef, int32 direction)
 
Command * opWalkTo (Script *script, const ResourceReference &objectRef, int32 suspend)
 
Command * opScriptPauseGameLoop (Script *script, int32 count)
 
Command * opScriptPause (Script *script, const ResourceReference &durationRef)
 
Command * opScriptPauseRandom (Script *script, const ResourceReference &itemRef)
 
Command * opScriptPauseSkippable (Script *script, const ResourceReference &durationRef)
 
Command * opScriptAbort (ResourceReference scriptRef, bool disable)
 
Command * opExit2DLocation ()
 
Command * opGoto2DLocation (const Common::String &level, const Common::String &location)
 
Command * opRumbleScene (Script *script, int32 rumbleDuration, int32 pause)
 
Command * opFadeScene (Script *script, bool fadeOut, int32 fadeDuration, bool pause)
 
Command * opSwayScene (int32 periodMs, int32 angleIn, int32 amplitudeIn, int32 offsetIn)
 
Command * opGameEnd ()
 
Command * opInventoryOpen (bool open)
 
Command * opFloatScene (int32 periodMs, int32 amplitudeIn, int32 offsetIn)
 
Command * opBookOfSecretsOpen ()
 
Command * opDoNothing ()
 
Command * opItem3DPlaceOn (const ResourceReference &itemRef, const ResourceReference &targetRef)
 
Command * opItem3DWalkTo (Script *script, const ResourceReference &itemRef, const ResourceReference &targetRef, bool suspend)
 
Command * opItemFollowPath (Script *script, ResourceReference itemRef, ResourceReference pathRef, uint32 speed, uint32 suspend)
 
Command * opItemLookAt (Script *script, const ResourceReference &itemRef, const ResourceReference &objRef, bool suspend, int32 unknown)
 
Command * opItemEnable (const ResourceReference &itemRef, int32 enable)
 
Command * opItemSetActivity (Script *script, const ResourceReference &itemRef, int32 animActivity, bool wait)
 
Command * opItemSelectInInventory (const ResourceReference &itemRef)
 
Command * opUseAnimHierachy (const ResourceReference &animHierRef)
 
Command * opPlayAnimation (Script *script, const ResourceReference &animRef, bool suspend)
 
Command * opScriptEnable (const ResourceReference &scriptRef, int32 enable)
 
Command * opShowPlay (Script *script, const ResourceReference &ref, int32 suspend)
 
Command * opKnowledgeSetBoolean (const ResourceReference &knowledgeRef, int32 enable)
 
Command * opKnowledgeSetInteger (const ResourceReference &knowledgeRef, int32 value)
 
Command * opKnowledgeSetIntRandom (const ResourceReference &knowledgeRef, uint32 min, uint32 max)
 
Command * opKnowledgeAddInteger (const ResourceReference &knowledgeRef, int32 increment)
 
Command * opKnowledgeSubValue (const ResourceReference &knowledgeRef, const ResourceReference &valueRef)
 
Command * opEnableFloorField (const ResourceReference &floorFieldRef, bool enable)
 
Command * opPlayAnimScriptItem (Script *script, const ResourceReference &animScriptItemRef, int32 suspend)
 
Command * opItemAnimFollowPath (Script *script, const ResourceReference &animRef, const ResourceReference &pathRef, int32 speed, bool suspend)
 
Command * opKnowledgeAssignBool (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
Command * opKnowledgeAssignNegatedBool (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
Command * opKnowledgeAssignInteger (const ResourceReference &knowledgeRef1, const ResourceReference &knowledgeRef2)
 
Command * opLocationScrollTo (Script *script, const ResourceReference &scrollRef, bool suspend)
 
Command * opSoundPlay (Script *script, const ResourceReference &soundRef, int32 suspend)
 
Command * opItemLookDirection (Script *script, const ResourceReference &itemRef, int32 direction, bool suspend)
 
Command * opStopPlayingSound (const ResourceReference &soundRef)
 
Command * opLayerGoTo (const ResourceReference &layerRef)
 
Command * opLayerEnable (const ResourceReference &layerRef, int32 enable)
 
Command * opLocationScrollSet (const ResourceReference &scrollRef)
 
Command * opFullMotionVideoPlay (Script *script, const ResourceReference &movieRef, int32 unknown)
 
Command * opAnimSetFrame (const ResourceReference &animRef, const ResourceReference &knowledgeRef)
 
Command * opDiaryEnableEntry (const ResourceReference &knowledgeRef)
 
Command * opPATChangeTooltip (const ResourceReference &patRef, const ResourceReference &stringRef)
 
Command * opSoundChange (Script *script, const ResourceReference &soundRef, int32 volume, int32 pan, int32 duration, bool pause)
 
Command * opLightSetColor (const ResourceReference &lightRef, int32 red, int32 green, int32 blue)
 
Command * opLightFollowPath (Script *script, const ResourceReference &itemRef, const ResourceReference &lightRef, const ResourceReference &pathRef, int32 speed, bool suspend)
 
Command * opItem3DRunTo (Script *script, const ResourceReference &itemRef, const ResourceReference &targetRef, int32 suspend)
 
Command * opItemPlaceDirection (const ResourceReference &itemRef, int32 direction)
 
Command * opItemRotateDirection (Script *script, const ResourceReference &itemRef, int32 direction, int32 speed, bool suspend)
 
Command * opActivateTexture (const ResourceReference &textureRef)
 
Command * opActivateMesh (const ResourceReference &meshRef)
 
Command * opItem3DSetWalkTarget (const ResourceReference &itemRef, const ResourceReference &targetRef)
 
Command * opSpeakWithoutTalking (Script *script, const ResourceReference &speechRef, int32 unknown)
 
Command * opIsOnFloorField (const ResourceReference &itemRef, const ResourceReference &floorFieldRef)
 
Command * opIsItemEnabled (const ResourceReference &itemRef)
 
Command * opIsScriptEnabled (const ResourceReference &scriptRef)
 
Command * opIsKnowledgeBooleanSet (const ResourceReference &knowledgeRef)
 
Command * opIsKnowledgeIntegerInRange (const ResourceReference &knowledgeRef, int32 min, int32 max)
 
Command * opIsKnowledgeIntegerAbove (const ResourceReference &knowledgeRef, int32 value)
 
Command * opIsKnowledgeIntegerEqual (const ResourceReference &knowledgeRef, int32 value)
 
Command * opIsKnowledgeIntegerLower (const ResourceReference &knowledgeRef, int32 value)
 
Command * opIsScriptActive (const ResourceReference &scriptRef)
 
Command * opIsRandom (int32 chance)
 
Command * opIsAnimScriptItemReached (const ResourceReference &animScriptItemRef)
 
Command * opIsItemNearPlace (const ResourceReference &itemRef, const ResourceReference &positionRef, int32 testDistance)
 
Command * opIsItemOnPlace (const ResourceReference &itemRef, const ResourceReference &positionRef)
 
Command * opIsAnimPlaying (const ResourceReference &animRef)
 
Command * opIsItemActivity (const ResourceReference &itemRef, int32 value)
 
Command * opIsAnimAtTime (const ResourceReference &animRef, int32 time)
 
Command * opIsLocation2D ()
 
Command * opIsInventoryOpen ()
 
- 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: