diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 11:43:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-01-16 11:43:34 +0100 |
commit | 3e07e568a1ae478b89812d91438d75179c94ab35 (patch) | |
tree | 85b4a9911dcc2fa661eac15a9a40ffbf813f0e89 /Tobii-EyeX/samples/ActivatableBoardGame/Board.h | |
parent | c61ba8892ce9b76bae4f60986b9d6724dad53254 (diff) |
remove obsolete Tobii EyeX SDK
Diffstat (limited to 'Tobii-EyeX/samples/ActivatableBoardGame/Board.h')
-rwxr-xr-x | Tobii-EyeX/samples/ActivatableBoardGame/Board.h | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/Tobii-EyeX/samples/ActivatableBoardGame/Board.h b/Tobii-EyeX/samples/ActivatableBoardGame/Board.h deleted file mode 100755 index d6abbe3..0000000 --- a/Tobii-EyeX/samples/ActivatableBoardGame/Board.h +++ /dev/null @@ -1,110 +0,0 @@ -/*
- * Board class: Implements the game logic and the not-so-clever AI player for the exciting Gobang game.
- *
- * Copyright 2013 Tobii Technology AB. All rights reserved.
- */
-
-#pragma once
-
-#include <random>
-
-class Observer;
-
-class Board
-{
-public:
- // Represents a position on the board.
- struct Position
- {
- int row;
- int column;
-
- Position(int paramRow, int paramColumn) : row(paramRow), column(paramColumn) { }
- };
-
- // Possible contents of a board position.
- enum Marker
- {
- None,
- X,
- O
- };
-
- Board(int size);
- virtual ~Board();
-
- // gets the size of the board, which is assumed to be square: the number of positions on each side.
- int Size() const { return _size; }
-
- // indicates whether the game is over.
- bool IsGameOver() const { return _playerInTurn == Marker::None; }
-
- // gets the "name" of the lucky winner.
- Marker GetWinner() const { return _winner; }
-
- // gets what's on the board at a given position.
- Marker GetMarkerAt(Position position) const;
-
- // indicates whether it is possible to place a marker at a given position.
- bool CanMakeMoveAt(Position position) const;
-
- // makes a move for the human player (which will also trigger an AI move).
- void MakeHumanPlayerMove(Position position);
-
- // restarts the game.
- void BeginNewGame();
-
- // registers an observer that is notified when the board has changed.
- void RegisterBoardChangedObserver(Observer* boardChangedObserver);
-
-private:
- enum Orientation
- {
- North,
- East,
- Northeast,
- Southeast,
- OrientationMaxValue
- };
-
- // tests whether a position is on the board.
- bool IsValidPosition(Position position) const;
-
- // gets a position adjacent to the given one, in a particular direction.
- Position GetAdjacentPosition(Position position, Orientation orientation, bool forward) const;
-
- // prepares the board for a new, exciting game.
- void InitBoard();
-
- // lets the miserable AI player make a move.
- void MakeAIPlayerMove();
-
- // makes a move: places a marker and checks whether anyone has won or if it's a draw game.
- void MakeMove(Position position);
-
- // places a marker at the given position.
- void SetMarkerAt(Position position, Marker marker);
-
- // checks if the given position is part of a winning sequence.
- void DetectWinner(Position position);
-
- // checks if the game is a draw.
- void DetectDrawGame();
-
- // notifies the observer, if any, that the board has changed.
- void NotifyObserver();
-
- static const int WinningSequenceLength = 5;
-
- static std::mt19937 _randomNumberGenerator;
-
- int _size;
- Marker* _board;
- Marker _playerInTurn;
- Marker _winner;
- Observer* _boardChangedObserver;
-
- // private copy constructor and operator making the class non-copyable (declared but not implemented).
- Board(const Board&);
- Board& operator = (const Board&);
-};
|