43 #ifndef DUMBO_TIC_TAC_TOE_BOARD_H
44 #define DUMBO_TIC_TAC_TOE_BOARD_H
46 #include <dumbo/core/game_state.h>
47 #include <dumbo/tic_tac_toe/square.h>
50 #include <unordered_set>
59 Board(
bool my_turn =
true) :
Board({}, my_turn) {}
60 Board(
const std::unordered_set<Square, Square::Hasher>& occupied_squares,
64 std::vector<Square> LegalMoves()
const {
return empty_squares_; }
71 bool NextState(
const Square& move, GameState* next_state)
const;
75 bool IsTerminal(
double* win)
const;
78 bool IsMyTurn()
const {
return my_turn_; }
81 bool operator==(
const GameState<Square>& rhs)
const;
92 std::unordered_set<Square, Square::Hasher> occupied_squares_;
93 std::vector<Square> empty_squares_;
96 typedef std::tuple<Square, Square, Square> SquareTuple;
97 static const std::vector<SquareTuple> winning_sets_;
98 static const std::vector<SquareTuple> losing_sets_;