Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc @ 12051

Last change on this file since 12051 was 12051, checked in by stadlero, 6 years ago

XML Funkion von Province-Klasse hinzugefuegt

File size: 1.0 KB
Line 
1
2
3
4
5
6
7#include "WagnisGameboard.h"
8#include "core/CoreIncludes.h"
9#include "BulletDynamics/Dynamics/btRigidBody.h"
10#include <vector>
11
12
13namespace orxonox
14{
15    RegisterClass(WagnisGameboard);
16   
17    WagnisGameboard::WagnisGameboard(Context* context) : StaticEntity(context){
18        RegisterObject(WagnisGameboard);
19    }
20
21    WagnisGameboard::~WagnisGameboard(){
22        for(WagnisProvince* prov:this->provs){
23            prov->destroy(); //destroys all Provinces
24        }
25    }
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);
33    }
34    //XML add province
35    //Adds a Province to the Gameboard
36    void WagnisGameboard::addProvince(WagnisProvince* province){
37        this->provs.push_back(province);
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}
Note: See TracBrowser for help on using the repository browser.