- Timestamp:
- Nov 7, 2018, 10:44:00 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/CMakeLists.txt
r12049 r12080 2 2 WagnisProvince.cc 3 3 WagnisGameboard.cc 4 WagnisPlayer.cc 4 5 ) 5 6 -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc
r12077 r12080 37 37 orxout() << "added" << endl; 38 38 orxout() << province->getID() << endl; 39 39 40 this->provs.push_back(province); 40 41 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
r12069 r12080 14 14 15 15 //Constructor 16 WagnisPlayer::WagnisPlayer(Context* context ) : OrxonoxClass(context){16 WagnisPlayer::WagnisPlayer(Context* context,WagnisGameboard* gb) : Baseclass(context){ 17 17 RegisterObject(WagnisPlayer); 18 this->origin = nullptr; 19 this->target = nullptr; 20 this->gameBoard = gb; 18 21 } 19 22 //Destructor … … 25 28 26 29 } 30 //checks if a move is valid 31 bool WagnisPlayer::checkMove(WagnisGameboard*,WagnisProvince*,WagnisProvince*){ 32 return false; 33 } 27 34 // 28 void WagnisPlayer::setTroops(WagnisGameboard* gameBoard,WagnisProvince* prov ){35 void WagnisPlayer::setTroops(WagnisGameboard* gameBoard,WagnisProvince* prov,MoveType type){ 29 36 30 37 } -
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
r12069 r12080 10 10 #include "core/CoreIncludes.h" 11 11 #include "core/XMLPort.h" 12 #include "WagnisProvince.h" 13 #include "WagnisGameboard.h" 12 14 #include <vector> 13 15 #include <string> 16 17 enum MoveType { ATTACK, MOVE, SET_TROOPS }; 14 18 15 19 … … 17 21 namespace orxonox 18 22 { 19 class WagnisPlayer : public OrxonoxClass23 class WagnisPlayer : public BaseClass 20 24 { 21 25 public: 22 WagnisPlayer(Context* );26 WagnisPlayer(Context*,WagnisGameboard*); 23 27 virtual ~WagnisPlayer(); 24 28 25 29 void playerTurn(WagnisGameboard*); 26 bool checkMove(Wagnis Gameboard*,WagnisProvince*,WagnisProvince*)27 void setTroops(Wagnis Gameboard*,WagnisProvince*);28 void attack(Wagnis Gameboard*,WagnisProvince*,WagnisProvince*);29 void moveTroops(Wagnis Gameboard*,WagnisProvince*,WagnisProvince*);30 bool checkMove(WagnisProvince*,WagnisProvince*,MoveType); 31 void setTroops(WagnisProvince*); 32 void attack(WagnisProvince*,WagnisProvince*); 33 void moveTroops(WagnisProvince*,WagnisProvince*); 30 34 std::string toString(); 31 35 32 36 private: 33 37 int Player_ID; 34 38 WagnisGameboard* gameBoard; 39 WagnisProvince* origin; 40 WagnisProvince* target; 35 41 }; 36 42 }
Note: See TracChangeset
for help on using the changeset viewer.