Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Eine XMLPort Funktion in der Gameboard-Klasse hinzugefügt

File size: 1.2 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
45
46
47    void WagnisGameboard::setPosition(const Vector3&){
48        //TODO
49    }
50    void WagnisGameboard::setOrientation(const Quaternion&){
51        //TODO
52    }
53}
Note: See TracBrowser for help on using the repository browser.