Source

python-ai / src / othello / Player.hpp

Full commit
#ifndef AI_OTHELLO_PLAYER_H
#define AI_OTHELLO_PLAYER_H

#include "Board.hpp"

class Player {
public:
    Player(const BoardPlayerNum num) {
        playerNum = num;
        otherNum = Board::otherPlayer(num);
    }
    virtual ~Player(void) = 0;
    virtual const BoardLoc chooseMove(const Board board,
                                      const BoardLocs locs) = 0;
    virtual string toString(void) const
        { return "PLAYER"; }
protected:
    BoardPlayerNum playerNum;
    BoardPlayerNum otherNum;
};

class HumanPlayer : public Player {
public:
    HumanPlayer(const BoardPlayerNum num) : Player(num) {}
    const BoardLoc chooseMove(const Board board, const BoardLocs locs);
    string toString(void) const
        { return "HUMAN_PLAYER"; }
};

class NaivePlayer : public Player {
public:
    NaivePlayer(const BoardPlayerNum num) : Player(num) {}
    const BoardLoc chooseMove(const Board board, const BoardLocs locs);
    string toString(void) const
        { return "NAIVE_PLAYER"; }
};


#endif