cmpsc330hw4/random_player.h

26 lines
502 B
C
Raw Normal View History

2024-11-19 23:54:26 +00:00
#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