Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc @ 12102

Last change on this file since 12102 was 12102, checked in by stadlero, 5 years ago

Billboard added to Province

File size: 2.3 KB
Line 
1#include "WagnisProvince.h"
2#include "core/CoreIncludes.h"
3#include "BulletDynamics/Dynamics/btRigidBody.h"
4#include "worldentities/StaticEntity.h"
5#include <vector>
6
7namespace orxonox
8{
9    RegisterClass(WagnisProvince);
10
11    //Constructor
12    WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){
13        RegisterObject(WagnisProvince);
14        this->owner_ID = 0;
15        this->troops = 0;
16        this->ID = -1;
17        this->continent = -1;
18        this->neighbors = std::vector<WagnisProvince*>();
19        this->markerBillboard = nullptr;
20    }
21    //Destructor
22    WagnisProvince::~WagnisProvince(){
23
24    }
25
26    //XML Port
27    void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){
28        SUPER(WagnisProvince, XMLPort, xmlelement, mode);
29
30        XMLPortObject(WagnisProvince, Billboard, "MarkerBillboard", addMarkerBillboard, getMarkerBillboard, xmlelement, mode);
31        XMLPortParam(WagnisProvince, "ID", setID, getID, xmlelement, mode);
32        XMLPortParam(WagnisProvince, "continent", setContinent, getContinent, xmlelement, mode);
33    }
34
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    }
43
44
45
46
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
70    int WagnisProvince::getOwner_ID() const{
71        return this->owner_ID;
72    }
73    //get troops
74    int WagnisProvince::getTroops() const{
75        return this->troops;
76    }
77    //get ID
78    int WagnisProvince::getID() const{
79        return this->ID;
80    }
81    //get continent
82    int WagnisProvince::getContinent() const{
83        return this-> continent;
84    }
85
86    //Adds a connection to neighbors.
87    void WagnisProvince::addNeighbor(WagnisProvince* prov){
88        neighbors.push_back(prov);
89    }
90}
Note: See TracBrowser for help on using the repository browser.