Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Wagnis class does now compile

File size: 2.6 KB
Line 
1
2
3#include "WagnisProvince.h"
4#include "core/CoreIncludes.h"
5#include "BulletDynamics/Dynamics/btRigidBody.h"
6#include "worldentities/StaticEntity.h"
7#include <vector>
8
9#define WAGNIS_PROVINCE_MAX_HEALTH 1000000.0f
10
11/**TODO
12 *
13 *
14 *
15 **/
16
17namespace orxonox
18{
19    RegisterClass(WagnisProvince);
20
21    //Constructor
22    WagnisProvince::WagnisProvince(Context* context) : Pawn(context){
23        RegisterObject(WagnisProvince);
24        this->owner_ID = 0;
25        this->troops = 0;
26        this->ID = -1;
27        this->continent = -1;
28        this->neighbors = std::vector<WagnisProvince*>();
29        this->markerBillboard = nullptr;
30        this->maxHealth_ = WAGNIS_PROVINCE_MAX_HEALTH;
31        this->health_ = WAGNIS_PROVINCE_MAX_HEALTH;
32       
33    }
34    //Destructor
35    WagnisProvince::~WagnisProvince(){
36
37    }
38
39    //XML Port
40    void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){
41        SUPER(WagnisProvince, XMLPort, xmlelement, mode);
42
43        XMLPortObject(WagnisProvince, Billboard, "MarkerBillboard", addMarkerBillboard, getMarkerBillboard, xmlelement, mode);
44        XMLPortParam(WagnisProvince, "ID", setID, getID, xmlelement, mode);
45        XMLPortParam(WagnisProvince, "continent", setContinent, getContinent, xmlelement, mode);
46    }
47
48    void WagnisProvince::addMarkerBillboard(Billboard* billi){
49        this->markerBillboard = billi;
50        attach(billi);
51    }
52    Billboard* WagnisProvince::getMarkerBillboard(unsigned int i) const{
53        if(i != 0) return nullptr;
54        return this->markerBillboard;
55    }
56
57
58
59
60    //SET()
61
62    //set owner_ID
63    void WagnisProvince::setOwner_ID(int owner){
64        this->owner_ID = owner;
65    }
66    //set troops
67    void WagnisProvince::setTroops(int troops){
68        this->troops = troops;
69    }
70    //set ID
71    void WagnisProvince::setID(int id){
72        this->ID = id;
73    }
74    //set Continent
75    void WagnisProvince::setContinent(int cont){
76        this->continent = cont;
77    }
78
79
80    //GET()
81
82    //get owner_ID
83    int WagnisProvince::getOwner_ID() const{
84        return this->owner_ID;
85    }
86    //get troops
87    int WagnisProvince::getTroops() const{
88        return this->troops;
89    }
90    //get ID
91    int WagnisProvince::getID() const{
92        return this->ID;
93    }
94    //get continent
95    int WagnisProvince::getContinent() const{
96        return this-> continent;
97    }
98
99    //Adds a connection to neighbors.
100    void WagnisProvince::addNeighbor(WagnisProvince* prov){
101        neighbors.push_back(prov);
102    }
103
104    void WagnisProvince::setBillbardVisibility(bool b){
105        //TODO set visibility of billboard
106    }
107}
Note: See TracBrowser for help on using the repository browser.