feat: added check_line for player win detection

This commit is contained in:
DarthMooMancer
2025-09-02 13:38:40 -04:00
parent 18773da6c4
commit 9546b47d82
6 changed files with 47 additions and 14 deletions
+8 -1
View File
@@ -1,6 +1,11 @@
#ifndef ELEMENTS_HPP
#define ELEMENTS_HPP
struct Player;
struct Point;
struct Tile;
struct Border;
struct Point {
Point();
Point(int row, int col) : m_row(row), m_col(col) {};
@@ -11,9 +16,11 @@ struct Point {
};
struct Player {
Player(char symbol, bool turn) : m_symbol(symbol), m_turn(turn) {};
Player(char symbol, bool turn) : m_symbol(symbol), m_turn(turn), m_win(false) {};
char m_symbol;
bool m_turn;
bool m_win;
void check_line(Tile (&tile_list)[9]);
};
struct Tile {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "elements.hpp"
struct Input {
int m_getch = 0;
int _getch = 0;
void get_input(bool &running, Tile (&tile_list)[9], Player &player_one, Player &player_two);
};