22#ifndef QUEEN_COMMAND_H
23#define QUEEN_COMMAND_H
25#include "common/util.h"
26#include "queen/structs.h"
44 void display(InkColor color,
const char *command = 0,
bool outlined =
false);
50 virtual void displayTemp(InkColor color,
const char *name,
bool outlined);
65 MAX_COMMAND_LEN = 256,
112 MAX_MATCHING_CMDS = 50
118 ObjectData *findObjectData(uint16 objRoomNum)
const;
121 ItemData *findItemData(Verb invNum)
const;
124 int16 executeCommand(uint16 comId, int16 condResult);
127 int16 makeJoeWalkTo(int16 x, int16 y, int16 objNum, Verb v,
bool mustWalk);
130 void grabCurrentSelection();
133 void grabSelectedObject(int16 objNum, uint16 objState, uint16 objName);
136 void grabSelectedItem();
139 void grabSelectedNoun();
142 void grabSelectedVerb();
145 bool executeIfCutaway(
const char *description);
148 bool executeIfDialog(
const char *description);
151 bool handleWrongAction();
154 void sayInvalidAction(Verb action, int16 subj1, int16 subj2);
157 void changeObjectState(Verb action, int16 obj, int16 song,
bool cutDone);
160 void cleanupCurrentAction();
163 void openOrCloseAssociatedObject(Verb action, int16 obj);
166 int16 setConditions(uint16 command,
bool lastCmd);
169 void setAreas(uint16 command);
172 void setObjects(uint16 command);
175 void setItems(uint16 command);
181 void lookAtSelectedObject();
184 void lookForCurrentObject(int16 cx, int16 cy);
187 void lookForCurrentIcon(int16 cx, int16 cy);
190 bool isVerbAction(Verb v)
const {
return (v >= VERB_PANEL_COMMAND_FIRST && v <= VERB_PANEL_COMMAND_LAST) || (v == VERB_WALK_TO); }
193 bool isVerbInv(Verb v)
const {
return v >= VERB_INV_FIRST && v <= VERB_INV_LAST; }
196 bool isVerbInvScroll(Verb v)
const {
return v == VERB_SCROLL_UP || v == VERB_SCROLL_DOWN; }
199 CmdListData *_cmdList;
207 CmdObject *_cmdObject;
208 uint16 _numCmdObject;
211 CmdInventory *_cmdInventory;
212 uint16 _numCmdInventory;
215 CmdGameState *_cmdGameState;
216 uint16 _numCmdGameState;
228 int _mouseKey, _selPosX, _selPosY;
virtual void addLinkWord(Verb v)
set the link word (between verb and object) for the command sentence
void displayTemp(InkColor color, Verb v)
display a temporary command sentence using the specified parameters
void clear()
reset the command sentence
virtual void displayTemp(InkColor color, const char *name, bool outlined)
display a temporary command sentence using the specified parameters
bool isEmpty() const
returns true if the command sentence is empty
Definition: command.h:62
virtual void addObject(const char *objName)
add an object name to the command sentence
void setVerb(Verb v)
set the verb for the command sentence
char _command[MAX_COMMAND_LEN]
buffer containing the current command sentence
Definition: command.h:72
void display(InkColor color, const char *command=0, bool outlined=false)
display the command sentence using the specified color
void clear(bool clearTexts)
initialize command construction
void readCommandsFrom(byte *&ptr)
read all command arrays from stream
void executeCurrentAction()
execute last constructed command
void updatePlayer()
get player input and construct command from it
Definition: structs.h:315
Definition: structs.h:185
Definition: structs.h:265