Changeset 12050
- Timestamp:
- Oct 21, 2018, 2:54:21 PM (6 years ago)
- Location:
- code/branches/wagnis_HS18/src/modules/wagnis
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12049 r12050 18 18 RegisterObject(WagnisGameboard); 19 19 } 20 20 21 WagnisGameboard::~WagnisGameboard(){ 22 for(WagnisProvince* prov:this->provs){ 23 prov->destroy(); //destroys all Provinces 24 } 25 } 21 26 27 28 29 //XML Port 30 void WagnisGameboard::XMLPort(Element& xmlelement,XMLPort::Mode mode){ 31 32 XMLPortObject(WagnisGameboard, WagnisProvince, "Province", addProvince, getProvince, xmlelement, mode); 22 33 } 23 //XML Port 24 void WagnisGameboard::XMLPort(Element& element,XMLPort::Mode mode){ 25 34 //XML add province 35 //Adds a Province to the Gameboard 36 void WagnisGameboard::addProvince(WagnisProvince* province){ 37 this->provs.push_back(province); 26 38 } 39 //XML get province 40 WagnisProvince* WagnisGameboard::getProvince(unsigned int index) const{ 41 if(this->provs.size() <= index) return nullptr; 42 return this->provs.at(index); 43 } 44 45 46 27 47 void WagnisGameboard::setPosition(const Vector3&){ 28 48 //TODO 29 49 } 30 50 void WagnisGameboard::setOrientation(const Quaternion&){ 31 51 //TODO 32 52 } 33 53 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.h
r12049 r12050 25 25 WagnisGameboard(Context*); 26 26 virtual ~WagnisGameboard(); 27 28 //XML 27 29 virtual void XMLPort(Element&,XMLPort::Mode); 30 void addProvince(WagnisProvince*); 31 WagnisProvince* getProvince(unsigned int) const; 32 // 28 33 29 34 void setPosition(const Vector3&) override; -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
r12049 r12050 21 21 this->ID = -1; 22 22 this->continent = -1; 23 this->neighbors = std::vector<WagnisProvince*>(); 23 24 } 24 25 //Destructor
Note: See TracChangeset
for help on using the changeset viewer.