OpenClonk
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

◆ C4CMD

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.

27 {
28  C4CMD_None,
32  C4CMD_Exit,
33  C4CMD_Grab,
36  C4CMD_Jump,
37  C4CMD_Wait,
38  C4CMD_Get,
39  C4CMD_Put,
40  C4CMD_Drop,
41  C4CMD_Dig,
46  C4CMD_Buy,
47  C4CMD_Sell,
50  C4CMD_Home,
51  C4CMD_Call,
52  C4CMD_Take,
54 };
@ C4CMD_Acquire
Definition: C4Command.h:48
@ C4CMD_Call
Definition: C4Command.h:51
@ C4CMD_Home
Definition: C4Command.h:50
@ C4CMD_Sell
Definition: C4Command.h:47
@ C4CMD_Drop
Definition: C4Command.h:40
@ C4CMD_Transfer
Definition: C4Command.h:44
@ C4CMD_Follow
Definition: C4Command.h:29
@ C4CMD_Activate
Definition: C4Command.h:42
@ C4CMD_Take
Definition: C4Command.h:52
@ C4CMD_Wait
Definition: C4Command.h:37
@ C4CMD_Attack
Definition: C4Command.h:45
@ C4CMD_Retry
Definition: C4Command.h:49
@ C4CMD_Get
Definition: C4Command.h:38
@ C4CMD_None
Definition: C4Command.h:28
@ C4CMD_MoveTo
Definition: C4Command.h:30
@ C4CMD_Take2
Definition: C4Command.h:53
@ C4CMD_Jump
Definition: C4Command.h:36
@ C4CMD_Put
Definition: C4Command.h:39
@ C4CMD_Enter
Definition: C4Command.h:31
@ C4CMD_PushTo
Definition: C4Command.h:43
@ C4CMD_Exit
Definition: C4Command.h:32
@ C4CMD_UnGrab
Definition: C4Command.h:35
@ C4CMD_Buy
Definition: C4Command.h:46
@ C4CMD_Throw
Definition: C4Command.h:34
@ C4CMD_Dig
Definition: C4Command.h:41
@ C4CMD_Grab
Definition: C4Command.h:33

Function Documentation

◆ CommandByName()

int32_t CommandByName ( const char *  szCommand)

Definition at line 126 of file C4Command.cpp.

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

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

Here is the call graph for this function:

◆ CommandName()

const char* CommandName ( int32_t  iCommand)

Definition at line 46 of file C4Command.cpp.

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

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().

Here is the caller graph for this function:

◆ CommandNameID()

const char* CommandNameID ( int32_t  iCommand)

Definition at line 80 of file C4Command.cpp.

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

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().

Here is the caller graph for this function:

Variable Documentation

◆ C4CMD_Enter_PushTarget

const int32_t C4CMD_Enter_PushTarget = 2

Definition at line 68 of file C4Command.h.

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

◆ C4CMD_First

const int32_t C4CMD_First = C4CMD_Follow

Definition at line 56 of file C4Command.h.

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

◆ C4CMD_Last

const int32_t C4CMD_Last = C4CMD_Take2

Definition at line 57 of file C4Command.h.

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

◆ C4CMD_Mode_Base

const int32_t C4CMD_Mode_Base = 1

Definition at line 60 of file C4Command.h.

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

◆ C4CMD_Mode_SilentBase

const int32_t C4CMD_Mode_SilentBase = 2

Definition at line 61 of file C4Command.h.

◆ C4CMD_Mode_SilentSub

const int32_t C4CMD_Mode_SilentSub = 0

Definition at line 59 of file C4Command.h.

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

◆ C4CMD_Mode_Sub

const int32_t C4CMD_Mode_Sub = 3

Definition at line 62 of file C4Command.h.

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

◆ C4CMD_MoveTo_NoPosAdjust

const int32_t C4CMD_MoveTo_NoPosAdjust = 1

Definition at line 65 of file C4Command.h.

Referenced by C4Command::InitEvaluation().

◆ C4CMD_MoveTo_PushTarget

const int32_t C4CMD_MoveTo_PushTarget = 2

Definition at line 66 of file C4Command.h.

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