feat: points and pointcollection
This commit is contained in:
@@ -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
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user