Trabalho Prático - PDS2
Carregando...
Procurando...
Nenhuma entrada encontrado
TTT.hpp
1
#ifndef TTT_HPP
2
#define TTT_HPP
3
4
#include <iostream>
5
6
#include "game.hpp"
7
#include "string_utils.hpp"
8
#include "exceptions.hpp"
9
10
class
TTT
:
public
Game
{
11
private
:
12
void
validateMove
(
int
row,
int
col);
13
14
int
checkLine
(
bool
isRow);
15
16
int
checkRows
();
17
18
int
checkColumns
();
19
20
int
checkDiagonals
();
21
22
public
:
23
24
TTT
();
25
26
void
readMove
()
override
;
27
28
void
makeMove
()
override
;
29
30
char
isGameFinished
()
override
;
31
32
//void printBoard() override;
33
};
34
35
#endif
Game
Definição
game.hpp:9
TTT
Definição
TTT.hpp:10
TTT::isGameFinished
char isGameFinished() override
Checks the current state of the game to determine if it has finished.
Definição
TTT.cpp:140
TTT::checkLine
int checkLine(bool isRow)
Checks if there is a winning line (row or column) in the Tic-Tac-Toe board.
Definição
TTT.cpp:79
TTT::checkRows
int checkRows()
Checks the rows in the Tic-Tac-Toe game for a win condition.
Definição
TTT.cpp:97
TTT::checkColumns
int checkColumns()
Checks the columns in the game.
Definição
TTT.cpp:106
TTT::makeMove
void makeMove() override
Makes a move in the Tic-Tac-Toe game.
Definição
TTT.cpp:62
TTT::TTT
TTT()
Constructs a TTT (Tic-Tac-Toe) game object.
Definição
TTT.cpp:6
TTT::checkDiagonals
int checkDiagonals()
Checks the diagonals of the Tic-Tac-Toe board to determine if there is a winner.
Definição
TTT.cpp:120
TTT::readMove
void readMove() override
Reads a move from the user and validates it.
Definição
TTT.cpp:13
TTT::validateMove
void validateMove(int row, int col)
Validates a move in the Tic-Tac-Toe game.
Definição
TTT.cpp:46
include
game
TTT.hpp
Gerado por
1.10.0