OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Command.h File Reference
#include "object/C4ObjectPtr.h"
#include "script/C4Value.h"
Include dependency graph for C4Command.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  C4Command
 

Enumerations

enum  C4CMD {
  C4CMD_None, C4CMD_Follow, C4CMD_MoveTo, C4CMD_Enter,
  C4CMD_Exit, C4CMD_Grab, C4CMD_Throw, C4CMD_UnGrab,
  C4CMD_Jump, C4CMD_Wait, C4CMD_Get, C4CMD_Put,
  C4CMD_Drop, C4CMD_Dig, C4CMD_Activate, C4CMD_PushTo,
  C4CMD_Transfer, C4CMD_Attack, C4CMD_Buy, C4CMD_Sell,
  C4CMD_Acquire, C4CMD_Retry, C4CMD_Home, C4CMD_Call,
  C4CMD_Take, C4CMD_Take2
}
 

Functions

const char * CommandName (int32_t iCommand)
 
const char * CommandNameID (int32_t iCommand)
 
int32_t CommandByName (const char *szCommand)
 

Variables

const int32_t C4CMD_First = C4CMD_Follow
 
const int32_t C4CMD_Last = C4CMD_Take2
 
const int32_t C4CMD_Mode_SilentSub = 0
 
const int32_t C4CMD_Mode_Base = 1
 
const int32_t C4CMD_Mode_SilentBase = 2
 
const int32_t C4CMD_Mode_Sub = 3
 
const int32_t C4CMD_MoveTo_NoPosAdjust = 1
 
const int32_t C4CMD_MoveTo_PushTarget = 2
 
const int32_t C4CMD_Enter_PushTarget = 2
 

Enumeration Type Documentation

enum C4CMD
Enumerator
C4CMD_None 
C4CMD_Follow 
C4CMD_MoveTo 
C4CMD_Enter 
C4CMD_Exit 
C4CMD_Grab 
C4CMD_Throw 
C4CMD_UnGrab 
C4CMD_Jump 
C4CMD_Wait 
C4CMD_Get 
C4CMD_Put 
C4CMD_Drop 
C4CMD_Dig 
C4CMD_Activate 
C4CMD_PushTo 
C4CMD_Transfer 
C4CMD_Attack 
C4CMD_Buy 
C4CMD_Sell 
C4CMD_Acquire 
C4CMD_Retry 
C4CMD_Home 
C4CMD_Call 
C4CMD_Take 
C4CMD_Take2 

Definition at line 26 of file C4Command.h.

Function Documentation

int32_t CommandByName ( const char *  szCommand)

Definition at line 127 of file C4Command.cpp.

References C4CMD_First, C4CMD_Last, C4CMD_None, CommandName(), and SEqual().

128 {
129  for (int32_t cnt=C4CMD_First; cnt<=C4CMD_Last; cnt++)
130  if (SEqual(szCommand,CommandName(cnt)))
131  return cnt;
132  return C4CMD_None;
133 }
const char * CommandName(int32_t iCommand)
Definition: C4Command.cpp:47
bool SEqual(const char *szStr1, const char *szStr2)
Definition: Standard.h:93
const int32_t C4CMD_First
Definition: C4Command.h:56
const int32_t C4CMD_Last
Definition: C4Command.h:57

Here is the call graph for this function:

const char* CommandName ( int32_t  iCommand)

Definition at line 47 of file C4Command.cpp.

References C4CMD_Acquire, C4CMD_Activate, C4CMD_Attack, C4CMD_Buy, C4CMD_Call, C4CMD_Dig, C4CMD_Drop, C4CMD_Enter, C4CMD_Exit, C4CMD_Follow, C4CMD_Get, C4CMD_Grab, C4CMD_Home, C4CMD_Jump, C4CMD_MoveTo, C4CMD_None, C4CMD_PushTo, C4CMD_Put, C4CMD_Retry, C4CMD_Sell, C4CMD_Take, C4CMD_Take2, C4CMD_Throw, C4CMD_Transfer, C4CMD_UnGrab, and C4CMD_Wait.

Referenced by CommandByName(), C4Object::Draw(), C4Object::ExecuteCommand(), C4Command::Fail(), InitEnumAdaptCommandEntries(), and C4Object::SetCommand().

48 {
49  switch (iCommand)
50  {
51  case C4CMD_None: return "None";
52  case C4CMD_Follow: return "Follow";
53  case C4CMD_MoveTo: return "MoveTo";
54  case C4CMD_Enter: return "Enter";
55  case C4CMD_Exit: return "Exit";
56  case C4CMD_Grab: return "Grab";
57  case C4CMD_Throw: return "Throw";
58  case C4CMD_UnGrab: return "UnGrab";
59  case C4CMD_Jump: return "Jump";
60  case C4CMD_Wait: return "Wait";
61  case C4CMD_Get: return "Get";
62  case C4CMD_Put: return "Put";
63  case C4CMD_Drop: return "Drop";
64  case C4CMD_Dig: return "Dig";
65  case C4CMD_Activate: return "Activate";
66  case C4CMD_PushTo: return "PushTo";
67  case C4CMD_Transfer: return "Transfer";
68  case C4CMD_Attack: return "Attack";
69  case C4CMD_Buy: return "Buy";
70  case C4CMD_Sell: return "Sell";
71  case C4CMD_Acquire: return "Acquire";
72  case C4CMD_Retry: return "Retry";
73  case C4CMD_Home: return "Home";
74  case C4CMD_Call: return "Call";
75  case C4CMD_Take: return "Take";
76  case C4CMD_Take2: return "Take2";
77  default: return "None";
78  }
79 }

Here is the caller graph for this function:

const char* CommandNameID ( int32_t  iCommand)

Definition at line 81 of file C4Command.cpp.

References C4CMD_Acquire, C4CMD_Activate, C4CMD_Attack, C4CMD_Buy, C4CMD_Call, C4CMD_Dig, C4CMD_Drop, C4CMD_Enter, C4CMD_Exit, C4CMD_Follow, C4CMD_Get, C4CMD_Grab, C4CMD_Home, C4CMD_Jump, C4CMD_MoveTo, C4CMD_None, C4CMD_PushTo, C4CMD_Put, C4CMD_Retry, C4CMD_Sell, C4CMD_Take, C4CMD_Take2, C4CMD_Throw, C4CMD_Transfer, C4CMD_UnGrab, and C4CMD_Wait.

Referenced by C4Command::Fail().

82 {
83  switch (iCommand)
84  {
85  case C4CMD_None: return "IDS_COMM_NONE";
86  case C4CMD_Follow: return "IDS_COMM_FOLLOW";
87  case C4CMD_MoveTo: return "IDS_COMM_MOVETO";
88  case C4CMD_Enter: return "IDS_COMM_ENTER";
89  case C4CMD_Exit: return "IDS_COMM_EXIT";
90  case C4CMD_Grab: return "IDS_COMM_GRAB";
91  case C4CMD_Throw: return "IDS_COMM_THROW";
92  case C4CMD_UnGrab: return "IDS_COMM_UNGRAB";
93  case C4CMD_Jump: return "IDS_COMM_JUMP";
94  case C4CMD_Wait: return "IDS_COMM_WAIT";
95  case C4CMD_Get: return "IDS_COMM_GET";
96  case C4CMD_Put: return "IDS_COMM_PUT";
97  case C4CMD_Drop: return "IDS_COMM_DROP";
98  case C4CMD_Dig: return "IDS_COMM_DIG";
99  case C4CMD_Activate: return "IDS_COMM_ACTIVATE";
100  case C4CMD_PushTo: return "IDS_COMM_PUSHTO";
101  case C4CMD_Transfer: return "IDS_COMM_TRANSFER";
102  case C4CMD_Attack: return "IDS_COMM_ATTACK";
103  case C4CMD_Buy: return "IDS_COMM_BUY";
104  case C4CMD_Sell: return "IDS_COMM_SELL";
105  case C4CMD_Acquire: return "IDS_COMM_ACQUIRE";
106  case C4CMD_Retry: return "IDS_COMM_RETRY";
107  case C4CMD_Home: return "IDS_CON_HOME";
108  case C4CMD_Call: return "IDS_COMM_CALL";
109  case C4CMD_Take: return "IDS_COMM_TAKE";
110  case C4CMD_Take2: return "IDS_COMM_TAKE2";
111  default: return "IDS_COMM_NONE";
112  }
113 }

Here is the caller graph for this function:

Variable Documentation

const int32_t C4CMD_Enter_PushTarget = 2

Definition at line 68 of file C4Command.h.

Referenced by C4Command::Enter(), and C4Command::PushTo().

const int32_t C4CMD_First = C4CMD_Follow

Definition at line 56 of file C4Command.h.

Referenced by C4Object::AddCommand(), CommandByName(), and InitEnumAdaptCommandEntries().

const int32_t C4CMD_Last = C4CMD_Take2

Definition at line 57 of file C4Command.h.

Referenced by C4Object::AddCommand(), CommandByName(), and InitEnumAdaptCommandEntries().

const int32_t C4CMD_Mode_Base = 1

Definition at line 60 of file C4Command.h.

Referenced by C4Command::Fail(), and C4Object::SetCommand().

const int32_t C4CMD_Mode_SilentBase = 2

Definition at line 61 of file C4Command.h.

const int32_t C4CMD_Mode_SilentSub = 0

Definition at line 59 of file C4Command.h.

Referenced by C4Command::Clear(), C4Command::Default(), and C4Command::Fail().

const int32_t C4CMD_Mode_Sub = 3

Definition at line 62 of file C4Command.h.

Referenced by C4Command::Acquire(), and C4Command::Fail().

const int32_t C4CMD_MoveTo_NoPosAdjust = 1

Definition at line 65 of file C4Command.h.

Referenced by C4Command::InitEvaluation().

const int32_t C4CMD_MoveTo_PushTarget = 2

Definition at line 66 of file C4Command.h.

Referenced by C4Command::Enter(), C4Command::MoveTo(), and C4Command::PushTo().