Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12080 for code


Ignore:
Timestamp:
Nov 7, 2018, 10:44:00 AM (6 years ago)
Author:
stadlero
Message:

private variables added in player class

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  
    22  WagnisProvince.cc
    33  WagnisGameboard.cc
     4  WagnisPlayer.cc
    45)
    56
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisGameboard.cc

    r12077 r12080  
    3737        orxout() << "added" << endl;
    3838        orxout() << province->getID() << endl;
     39       
    3940        this->provs.push_back(province);
    4041    }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc

    r12069 r12080  
    1414
    1515    //Constructor
    16     WagnisPlayer::WagnisPlayer(Context* context) : OrxonoxClass(context){
     16    WagnisPlayer::WagnisPlayer(Context* context,WagnisGameboard* gb) : Baseclass(context){
    1717        RegisterObject(WagnisPlayer);
     18        this->origin = nullptr;
     19        this->target = nullptr;
     20        this->gameBoard = gb;
    1821    }
    1922    //Destructor
     
    2528       
    2629    }
     30    //checks if a move is valid
     31    bool WagnisPlayer::checkMove(WagnisGameboard*,WagnisProvince*,WagnisProvince*){
     32        return false;
     33    }
    2734    //
    28     void WagnisPlayer::setTroops(WagnisGameboard* gameBoard,WagnisProvince* prov){
     35    void WagnisPlayer::setTroops(WagnisGameboard* gameBoard,WagnisProvince* prov,MoveType type){
    2936
    3037    }
  • code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h

    r12069 r12080  
    1010#include "core/CoreIncludes.h"
    1111#include "core/XMLPort.h"
     12#include "WagnisProvince.h"
     13#include "WagnisGameboard.h"
    1214#include <vector>
    1315#include <string>
     16
     17enum MoveType { ATTACK, MOVE, SET_TROOPS };
    1418
    1519
     
    1721namespace orxonox
    1822{
    19     class WagnisPlayer : public OrxonoxClass
     23    class WagnisPlayer : public BaseClass
    2024    {
    2125    public:
    22         WagnisPlayer(Context*);
     26        WagnisPlayer(Context*,WagnisGameboard*);
    2327        virtual ~WagnisPlayer();
    2428
    2529        void playerTurn(WagnisGameboard*);
    26         bool checkMove(WagnisGameboard*,WagnisProvince*,WagnisProvince*)
    27         void setTroops(WagnisGameboard*,WagnisProvince*);
    28         void attack(WagnisGameboard*,WagnisProvince*,WagnisProvince*);
    29         void moveTroops(WagnisGameboard*,WagnisProvince*,WagnisProvince*);
     30        bool checkMove(WagnisProvince*,WagnisProvince*,MoveType);
     31        void setTroops(WagnisProvince*);
     32        void attack(WagnisProvince*,WagnisProvince*);
     33        void moveTroops(WagnisProvince*,WagnisProvince*);
    3034        std::string toString();
    3135
    3236    private:
    3337        int Player_ID;
    34 
     38        WagnisGameboard* gameBoard;
     39        WagnisProvince* origin;
     40        WagnisProvince* target;
    3541    };
    3642}
Note: See TracChangeset for help on using the changeset viewer.