-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDinosaur.h
74 lines (58 loc) · 1.13 KB
/
Dinosaur.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
/*
Class Dinosaur that represents its atrributes and behaviour.
Dinosaur have and Attack array object where each dinosaur has 4 attacks.
*/
#ifndef DINOSAURIO_H_INCLUDED
#define DINOSAURIO_H_INCLUDED
#include <iostream>
#include "Attack.h"
class Dinosaur
{
private:
int id;
std::string name;
int health = 100;
public:
Dinosaur()
{
};
Dinosaur (int i, std::string n)
:id(i),name(n)
{
}
Attack attacks[4];
int getId()
{
return this->id;
}
void setId(int i)
{
this->id = i;
}
int getHealth()
{
return this->health;
}
void setHealth(int s)
{
this->health = s;
}
void setName(std::string n)
{
this->name = n;
}
std::string getName()
{
return this->name;
}
void debug()
{
std::cout<<"id: "<<this->getId()<<" Name: "<<this->getName()<<" Health: "<<this->getHealth()<<"\n";
for(int i = 0; i<4; i++)
{
std::cout<<" Attack:["<<i+1<<"] "<<attacks[i].getName()<<"\n";
}
std::cout<<"\n";
}
};
#endif // DINOSAURIO_H_INCLUDED