-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.h
More file actions
61 lines (55 loc) · 1.34 KB
/
Command.h
File metadata and controls
61 lines (55 loc) · 1.34 KB
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
class Command {
public:
Command(int cmd, int posx, int posy,int direction, int id);
~Command(){};
int getx();
int gety();
int get();
int getdir();
int getid();
private:
int posx,posy,direction,cmd,id;
};
Command::Command(int cmd, int posx, int posy, int direction, int id=-1) {
this->cmd = cmd;
this->posx = posx;
this->posy = posy;
this->direction = direction;
this->id = id;
return;
}
int Command::getx(){return this->posx;}
int Command::gety(){return this->posy;}
int Command::get(){return this->cmd;}
int Command::getdir() {return this->direction;}
int Command::getid() {return this->id;}
class Template{
public:
string texture,name;
int id,hp,dpf,def,speed,q[2],*bufs,*units;
Template(string name,string texture,int* stats,int* quantity,int* bufs,int* units);
~Template(){};
};
Template::Template(string name,string texture,int* stats,int* quantity,int* bufs,int* units){
this->name=name;
this->texture=texture;
id=stats[0];
hp=stats[1];
dpf=stats[2];
def=stats[3];
speed=stats[4];
int i=0;
if(quantity[0]!=0){
this->bufs= new int[quantity[0]];
while(i<quantity[0]){
this->bufs[i]=bufs[i];
i++;
}}
i=0;
if(quantity[1]!=0){
this->units= new int[quantity[1]];
while(i<quantity[1]){
this->units[i]=units[i];
i++;
}}
}