changes
This commit is contained in:
+1
-1
@@ -10,6 +10,6 @@ struct Fruit {
|
||||
Point m_point;
|
||||
Fruit();
|
||||
void create_point();
|
||||
void reset(std::array<std::array<char, COL>, ROW> &arr);
|
||||
void reset(std::array<std::array<char, COL>, ROW> &arr, int row, int col, int &score);
|
||||
};
|
||||
#endif // FRUIT_HPP
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ struct Point {
|
||||
Point() {}
|
||||
Point(int x, int y) : m_row(x), m_col(y) {}
|
||||
|
||||
std::string get_point() const;
|
||||
std::string to_string() const;
|
||||
void clear(std::array<std::array<char, COL>, ROW> &arr) const;
|
||||
std::pair<int, int> get_point(int direction, int row, int col);
|
||||
};
|
||||
|
||||
+9
-3
@@ -1,11 +1,17 @@
|
||||
#ifndef SNAKE_HPP
|
||||
#define SNAKE_HPP
|
||||
|
||||
#include <vector>
|
||||
#include "point.hpp"
|
||||
|
||||
struct Snake {
|
||||
Snake(int default_direction);
|
||||
int get_direction() const;
|
||||
void set_direction(int x);
|
||||
int direction; // 1: Down, 2: Up, 3: Left, 4: Right
|
||||
void create_tail(int row, int col);
|
||||
void update_tails_count();
|
||||
|
||||
std::vector<Point> m_tails;
|
||||
int m_direction; // 1: Down, 2: Up, 3: Left, 4: Right
|
||||
int m_tails_count;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user