-
Notifications
You must be signed in to change notification settings - Fork 3
/
InternalObjectCmd.h
executable file
·90 lines (75 loc) · 1.66 KB
/
InternalObjectCmd.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#include "TrackCmd.h"
#define INTERAL_CMD_TEXTURE_03 1
#define INTERAL_CMD_TEXTURE_83 2
class InternalObjectCmd : public Observer
, public CObject
{
public:
int cmdType;
InternalObjectCmd(GPTrack *mytrack, int type, int num)
: Observer(mytrack, t_Command, NULL), cmdType(type)
{
args = new Vector("Object Cmds", __LINE__);
for (int i = 0; i < num; i++) {
TrackArg *arg = new TrackArg(0, GP_CMD_WORD, "Unk");
args->addElement(arg);
}
}
int Open();
inline int
getCmd()
{
return cmdType;
}
inline int
getCmdNumArgs()
{
if (args)
return args->size();
else {
AfxMessageBox("getCmdNumArgs size bads arguments");
return 0;
}
}
void
AddWordArgument(int arg, LPCSTR name)
{
TrackArg *targ = new TrackArg(arg, GP_CMD_WORD, name);
args->addElement(targ);
}
int getNthArg(int idx)
{
TrackArg *targ = (TrackArg *)args->elementAt(idx - 1);
if (targ)
return targ->getValue();
else {
AfxMessageBox("getNthArg: No Cmd Arg", MB_OK);
return 0;
}
}
DataValue *
getNthArgDataValue(int idx)
{
TrackArg *targ = (TrackArg *)args->elementAt(idx - 1);
if (targ) return &(targ->value);
return NULL;
}
void
setNthArg(int idx, int val)
{
TrackArg *targ = (TrackArg *)args->elementAt(idx - 1);
if (targ)
targ->setValue(val);
else {
AfxMessageBox("setNthArg No Cmd Arg", MB_OK);
}
}
void
LoadPropertyTable(CTrackPropertySheet *table);
BOOL
isMultiVariable()
{
return TRUE;
}
Vector *args;
};