This commit is contained in:
DarthMooMancer
2025-10-07 12:08:57 -04:00
parent d8a3fee987
commit 85aebae86d
7 changed files with 144 additions and 98 deletions
+12 -22
View File
@@ -1,34 +1,24 @@
#ifndef ELEMENTS_HPP
#define ELEMENTS_HPP
struct Point;
struct Player;
void cleanup(Point** buffer, int buffer_size);
void allocate_points(Point** buffer, char symbol);
Player* get_current_player(Player* current_player, Player* player_one, Player* player_two);
struct Point {
Point(int row, int col, char symbol) : m_row(row), m_col(col), m_symbol(symbol) {};
int m_row;
int m_col;
char m_symbol;
void assign(int row, int col);
};
// struct Tile {
// Tile(int row, int col) : m_pos(row, col), m_symbol(' '), _delete(false) {};
// Tile(int row, int col, char symbol) : m_pos(row, col), m_symbol(symbol), _delete(false) {};
// char m_symbol;
// Point m_pos;
// bool _delete;
// };
//
// struct Border {
// Border(int row, int col, char symbol) : m_pos(row, col), m_symbol(symbol) {};
// char m_symbol;
// Point m_pos;
// };
//
// struct Player {
// 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 Player {
Player(char symbol, bool turn, int id) : m_symbol(symbol), m_id(id) {};
char m_symbol;
int m_id;
bool on_line(Point** buffer);
};
#endif
+1 -1
View File
@@ -2,6 +2,6 @@
#define GLOBALS_HPP
#define ROW 5
#define COL 5
#define FMPS 150
#define FMPS 16
#endif
+1 -2
View File
@@ -4,8 +4,7 @@
struct Input {
int _getch = 0;
// void get_input(bool &running, Tile (&tile_list)[9], Player &player_one, Player &player_two);
void get_input(bool &running);
void get_input(bool &running, Point** buffer, Player *&current_player, Player *player_one, Player *player_two);
};
#endif