1 | #include "WagnisProvince.h" |
---|
2 | #include "core/CoreIncludes.h" |
---|
3 | #include "BulletDynamics/Dynamics/btRigidBody.h" |
---|
4 | #include <vector> |
---|
5 | |
---|
6 | namespace orxonox |
---|
7 | { |
---|
8 | RegisterClass(WagnisProvince); |
---|
9 | |
---|
10 | //Constructor |
---|
11 | WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){ |
---|
12 | RegisterObject(WagnisProvince); |
---|
13 | this->owner_ID = 0; |
---|
14 | this->troops = 0; |
---|
15 | this->ID = -1; |
---|
16 | this->continent = -1; |
---|
17 | this->neighbors = std::vector<WagnisProvince*>(); |
---|
18 | } |
---|
19 | //Destructor |
---|
20 | WagnisProvince::~WagnisProvince(){ |
---|
21 | |
---|
22 | } |
---|
23 | |
---|
24 | //XML Port |
---|
25 | void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){ |
---|
26 | SUPER(WagnisProvince, XMLPort, xmlelement, mode); |
---|
27 | |
---|
28 | XMLPortParam(WagnisProvince, "ID", setID, getID, xmlelement, mode); |
---|
29 | XMLPortParam(WagnisProvince, "continent", setContinent, getContinent, xmlelement, mode); |
---|
30 | } |
---|
31 | |
---|
32 | |
---|
33 | |
---|
34 | |
---|
35 | //SET() |
---|
36 | |
---|
37 | //set owner_ID |
---|
38 | void WagnisProvince::setOwner_ID(int owner){ |
---|
39 | this->owner_ID = owner; |
---|
40 | } |
---|
41 | //set troops |
---|
42 | void WagnisProvince::setTroops(int troops){ |
---|
43 | this->troops = troops; |
---|
44 | } |
---|
45 | //set ID |
---|
46 | void WagnisProvince::setID(int id){ |
---|
47 | this->ID = id; |
---|
48 | } |
---|
49 | //set Continent |
---|
50 | void WagnisProvince::setContinent(int cont){ |
---|
51 | this->continent = cont; |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
55 | //GET() |
---|
56 | |
---|
57 | //get owner_ID |
---|
58 | int WagnisProvince::getOwner_ID() const{ |
---|
59 | return this->owner_ID; |
---|
60 | } |
---|
61 | //get troops |
---|
62 | int WagnisProvince::getTroops() const{ |
---|
63 | return this->troops; |
---|
64 | } |
---|
65 | //get ID |
---|
66 | int WagnisProvince::getID() const{ |
---|
67 | return this->ID; |
---|
68 | } |
---|
69 | //get continent |
---|
70 | int WagnisProvince::getContinent() const{ |
---|
71 | return this-> continent; |
---|
72 | } |
---|
73 | |
---|
74 | //Creates a connection between two provinces. |
---|
75 | void WagnisProvince::addNeighbor(WagnisProvince* prov){ |
---|
76 | neighbors.push_back(prov); |
---|
77 | prov->neighbors.push_back(this); |
---|
78 | } |
---|
79 | } |
---|