fix(snake.cpp .hpp): first step to extracting tail functions and head movement to just head and tail separately
This commit is contained in:
+8
-6
@@ -23,19 +23,21 @@
|
||||
* separate the snake and tail from each other
|
||||
* */
|
||||
|
||||
struct Snake {
|
||||
Snake(int default_direction, int row, int col);
|
||||
struct Head {
|
||||
Head(int default_direction, int row, int col);
|
||||
Point m_head;
|
||||
std::vector<Point> m_tails;
|
||||
// 1: Down, 2: Up, 3: Left, 4: Right
|
||||
// -1: Left, 1: Right, 2: Down, -2: Up
|
||||
int m_direction;
|
||||
// Adds a new tail to m_tails at { row, col }
|
||||
void create_tail(int row, int col);
|
||||
void get_new_head_point(int tail_index, int direction);
|
||||
void get_new_point(int direction);
|
||||
};
|
||||
|
||||
// struct Tail {
|
||||
//
|
||||
// }
|
||||
struct Tail {
|
||||
Point m_tail_pos;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user