26 lines
502 B
C
26 lines
502 B
C
|
#ifndef HW4_RANDOM_PLAYER_H
|
||
|
#define HW4_RANDOM_PLAYER_H
|
||
|
|
||
|
#include "board.h"
|
||
|
#include "player.h"
|
||
|
#include <cstdlib>
|
||
|
#include <ctime>
|
||
|
|
||
|
class RandomPlayer: public Player {
|
||
|
private:
|
||
|
char name;
|
||
|
public:
|
||
|
RandomPlayer(char name): Player(name) {
|
||
|
srand(static_cast<unsigned int>(time(nullptr)));
|
||
|
|
||
|
this->name = name;
|
||
|
}
|
||
|
void selectLineLocation(Board& board, int& row, int& col);
|
||
|
|
||
|
char getName() const override {
|
||
|
return this->name;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
#endif //HW4_RANDOM_PLAYER_H
|