Changeset 12051
- Timestamp:
- Oct 24, 2018, 11:22:05 AM (6 years ago)
- Location:
- code/branches/wagnis_HS18/src/modules/wagnis
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12050 r12051 42 42 return this->provs.at(index); 43 43 } 44 45 46 47 void WagnisGameboard::setPosition(const Vector3&){48 //TODO49 }50 void WagnisGameboard::setOrientation(const Quaternion&){51 //TODO52 }53 44 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.h
r12050 r12051 32 32 // 33 33 34 void setPosition(const Vector3&) override;35 void setOrientation(const Quaternion&) override;36 37 34 38 35 private: 39 36 std::vector<WagnisProvince*> provs; 40 Vector3 position;41 Quaternion orientation;42 37 }; 43 38 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
r12050 r12051 15 15 16 16 //Constructor 17 WagnisProvince::WagnisProvince(Context* context) : StaticEntity(context){17 WagnisProvince::WagnisProvince(Context* context) : MovableEntity(context){ 18 18 RegisterObject(WagnisProvince); 19 19 this->owner_ID = 0; … … 28 28 } 29 29 30 //XML Port 31 void WagnisProvince::XMLPort(Element& xmlelement,XMLPort::Mode mode){ 32 XMLPortParam(WagnisProvince, "ID", setID, getID, xmlelement, mode); 33 XMLPortParam(WagnisProvince, "continent", setContinent, getContinent, xmlelement, mode); 34 } 35 30 36 31 37 … … 33 39 //SET() 34 40 35 //set Position36 void WagnisProvince::setPosition(const Vector3& position){37 //TODO38 }39 //set Orientation40 void WagnisProvince::setOrientation(const Quaternion& orientation){41 //TODO42 }43 41 //set owner_ID 44 42 void WagnisProvince::setOwner_ID(int owner){ … … 62 60 63 61 //get owner_ID 64 int WagnisProvince::getOwner_ID() {62 int WagnisProvince::getOwner_ID() const{ 65 63 return this->owner_ID; 66 64 } 67 65 //get troops 68 int WagnisProvince::getTroops() {66 int WagnisProvince::getTroops() const{ 69 67 return this->troops; 70 68 } 71 69 //get ID 72 int WagnisProvince::getID() {70 int WagnisProvince::getID() const{ 73 71 return this->ID; 74 72 } 75 73 //get continent 76 int WagnisProvince::getContinent() {74 int WagnisProvince::getContinent() const{ 77 75 return this-> continent; 78 76 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.h
r12049 r12051 10 10 #include "core/CoreIncludes.h" 11 11 #include "core/XMLPort.h" 12 #include "worldentities/ StaticEntity.h"12 #include "worldentities/MovableEntity.h" 13 13 #include <vector> 14 14 … … 16 16 namespace orxonox 17 17 { 18 class WagnisProvince : public StaticEntity18 class WagnisProvince : public MovableEntity 19 19 { 20 20 public: 21 21 WagnisProvince(Context*); 22 22 virtual ~WagnisProvince(); 23 void setPosition(const Vector3&) override; 24 void setOrientation(const Quaternion&) override; 25 void addNeighbor(WagnisProvince*); 23 virtual void XMLPort(Element&,XMLPort::Mode); 26 24 27 25 void setOwner_ID(int); … … 30 28 void setContinent(int); 31 29 32 int getOwner_ID() ;33 int getTroops() ;34 int getID() ;35 int getContinent() ;30 int getOwner_ID() const; 31 int getTroops() const; 32 int getID() const; 33 int getContinent() const; 36 34 37 35 void addNeighbor(WagnisProvince*); 36 38 37 private: 39 38 int owner_ID; … … 42 41 int continent; 43 42 std::vector<WagnisProvince*> neighbors; 44 Vector3 position;45 Quaternion orientation;46 43 }; 47 44 }
Note: See TracChangeset
for help on using the changeset viewer.