29 lines
540 B
C++
29 lines
540 B
C++
#ifndef ELEMENT_HPP
|
|
#define ELEMENT_HPP
|
|
|
|
#include "globals.hpp"
|
|
|
|
enum Direction {
|
|
UP = -2,
|
|
DOWN = 2,
|
|
LEFT = -1,
|
|
RIGHT = 1
|
|
};
|
|
|
|
struct Vector2i {
|
|
int x, y;
|
|
char id;
|
|
enum Direction m_dir;
|
|
Vector2i() : x(0), y(0), id('@') {}
|
|
Vector2i(int x, int y, char s) : x(x), y(y), id(s) {}
|
|
void set(int x, int y);
|
|
};
|
|
|
|
int get_score();
|
|
void determine_index_zero_pos(Vector2i** buf);
|
|
void move_tail_indicies(Vector2i** buf);
|
|
void on_fruit_eaten(Vector2i (*board)[COL], Vector2i** buf);
|
|
bool segment_overlap(Vector2i** buf);
|
|
|
|
#endif // ELEMENT_HPP
|