feat: check_chain checks for horizontal, vertical and diagonal with bug on diagonal if block hasnt gone all the way down yet

This commit is contained in:
DarthMooMancer
2025-09-08 09:09:39 -04:00
parent 51ba052d9a
commit 0f7984e1d0
3 changed files with 43 additions and 24 deletions
+6 -2
View File
@@ -1,15 +1,17 @@
#ifndef ELEMENTS_HPP
#define ELEMENTS_HPP
#include "globals.hpp"
#include <vector>
struct Point {
Point() : m_row(0), m_col(0), m_id(0) {}
Point(int row, int col, int id) : m_row(row), m_col(col), m_id(id) {}
Point() : m_row(0), m_col(0), m_id(0), m_collided(false) {}
Point(int row, int col, int id) : m_row(row), m_col(col), m_id(id), m_collided(false) {}
int m_row;
int m_col;
int m_id;
char m_symbol;
bool m_collided;
void to_string();
void assign(int row, int col);
void move();
@@ -21,6 +23,8 @@ struct Player {
char m_symbol;
bool m_turn;
void input_tile(int col, std::vector<Point> &points);
// bool check_chain(std::array<std::array<char, COL>, ROW> &m_board);
bool check_chain(std::array<std::array<char, COL>, ROW> &m_board, std::vector<Point> &points_list);
};
#endif