feat: points and pointcollection

This commit is contained in:
DarthMooMancer
2025-09-10 18:42:07 -04:00
parent 4c1d4d5185
commit e64017f556
8 changed files with 90 additions and 10 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef ELEMENTS_HPP
#define ELEMENTS_HPP
#include <vector>
#include "globals.hpp"
struct Point {
Point() : m_row(0), m_col(0), m_symbol(2), m_direction('n') {};
Point(int row, int col) : m_row(row), m_col(col), m_symbol(2), m_direction('n') {};
char m_direction;
int m_row;
int m_col;
int m_symbol;
void assign(int row, int col);
};
struct PointCollection {
std::vector<Point> m_point_list;
void move();
void set_direction(char direction);
};
#endif
+3 -1
View File
@@ -1,9 +1,11 @@
#ifndef INPUT_HPP
#define INPUT_HPP
#include "elements.hpp"
struct Input {
int _getch;
void get_input(bool &running);
void get_input(bool &running, PointCollection &collection);
};
#endif
+2 -1
View File
@@ -2,11 +2,12 @@
#define WINDOW_HPP
#include "globals.hpp"
#include "elements.hpp"
#include <array>
struct Window {
std::array<std::array<int, COL>, ROW> m_board = {};
void draw_window();
void draw_window(PointCollection &collection);
};
#endif