[12049] | 1 | #include "WagnisProvince.h" |
---|
| 2 | #include "core/CoreIncludes.h" |
---|
| 3 | #include "BulletDynamics/Dynamics/btRigidBody.h" |
---|
[12102] | 4 | #include "worldentities/StaticEntity.h" |
---|
[12049] | 5 | #include <vector> |
---|
| 6 | |
---|
| 7 | namespace orxonox |
---|
| 8 | { |
---|
| 9 | RegisterClass(WagnisProvince); |
---|
| 10 | |
---|
| 11 | //Constructor |
---|
[12051] | 12 | WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){ |
---|
[12049] | 13 | RegisterObject(WagnisProvince); |
---|
| 14 | this->owner_ID = 0; |
---|
| 15 | this->troops = 0; |
---|
| 16 | this->ID = -1; |
---|
| 17 | this->continent = -1; |
---|
[12050] | 18 | this->neighbors = std::vector<WagnisProvince*>(); |
---|
[12102] | 19 | this->markerBillboard = nullptr; |
---|
[12049] | 20 | } |
---|
| 21 | //Destructor |
---|
| 22 | WagnisProvince::~WagnisProvince(){ |
---|
| 23 | |
---|
| 24 | } |
---|
| 25 | |
---|
[12051] | 26 | //XML Port |
---|
| 27 | void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){ |
---|
[12067] | 28 | SUPER(WagnisProvince, XMLPort, xmlelement, mode); |
---|
| 29 | |
---|
[12102] | 30 | XMLPortObject(WagnisProvince, Billboard, "MarkerBillboard", addMarkerBillboard, getMarkerBillboard, xmlelement, mode); |
---|
[12051] | 31 | XMLPortParam(WagnisProvince, "ID", setID, getID, xmlelement, mode); |
---|
| 32 | XMLPortParam(WagnisProvince, "continent", setContinent, getContinent, xmlelement, mode); |
---|
| 33 | } |
---|
[12049] | 34 | |
---|
[12102] | 35 | void WagnisProvince::addMarkerBillboard(Billboard* billi){ |
---|
| 36 | this->markerBillboard = billi; |
---|
| 37 | attach(billi); |
---|
| 38 | } |
---|
| 39 | Billboard* WagnisProvince::getMarkerBillboard(unsigned int i) const{ |
---|
| 40 | if(i != 0) return nullptr; |
---|
| 41 | return this->markerBillboard; |
---|
| 42 | } |
---|
[12049] | 43 | |
---|
| 44 | |
---|
[12051] | 45 | |
---|
[12102] | 46 | |
---|
[12049] | 47 | //SET() |
---|
| 48 | |
---|
| 49 | //set owner_ID |
---|
| 50 | void WagnisProvince::setOwner_ID(int owner){ |
---|
| 51 | this->owner_ID = owner; |
---|
| 52 | } |
---|
| 53 | //set troops |
---|
| 54 | void WagnisProvince::setTroops(int troops){ |
---|
| 55 | this->troops = troops; |
---|
| 56 | } |
---|
| 57 | //set ID |
---|
| 58 | void WagnisProvince::setID(int id){ |
---|
| 59 | this->ID = id; |
---|
| 60 | } |
---|
| 61 | //set Continent |
---|
| 62 | void WagnisProvince::setContinent(int cont){ |
---|
| 63 | this->continent = cont; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | //GET() |
---|
| 68 | |
---|
| 69 | //get owner_ID |
---|
[12051] | 70 | int WagnisProvince::getOwner_ID() const{ |
---|
[12049] | 71 | return this->owner_ID; |
---|
| 72 | } |
---|
| 73 | //get troops |
---|
[12051] | 74 | int WagnisProvince::getTroops() const{ |
---|
[12049] | 75 | return this->troops; |
---|
| 76 | } |
---|
| 77 | //get ID |
---|
[12051] | 78 | int WagnisProvince::getID() const{ |
---|
[12049] | 79 | return this->ID; |
---|
| 80 | } |
---|
| 81 | //get continent |
---|
[12051] | 82 | int WagnisProvince::getContinent() const{ |
---|
[12049] | 83 | return this-> continent; |
---|
| 84 | } |
---|
| 85 | |
---|
[12072] | 86 | //Adds a connection to neighbors. |
---|
[12049] | 87 | void WagnisProvince::addNeighbor(WagnisProvince* prov){ |
---|
| 88 | neighbors.push_back(prov); |
---|
| 89 | } |
---|
| 90 | } |
---|