-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snake.hpp
65 lines (56 loc) · 1.03 KB
/
Snake.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Snake.hpp for Snake.hpp in /home/han_d/Github/cpp_nibbler
//
// Made by Daniel Han
// Login <han_d@epitech.net>
//
// Started on Sun Apr 5 07:25:22 2015 Daniel Han
// Last update Sun Apr 5 07:25:45 2015 Daniel Han
//
#ifndef _SNAKE_HPP_
# define _SNAKE_HPP_
#include <list>
#include "Event.hpp"
#include "Position.hpp"
#include "IGui.hpp"
#include "Map.hpp"
#define MAX_SPEED 20000
class Snake
{
//
// Attributs
//
private:
bool god_mode;
int x;
int y;
int size;
int speed;
IGui *gui;
std::list<Position> body;
//
// Coplien form
//
public:
Snake(int const, int const, IGui *);
Snake(Snake const &);
Snake &operator=(Snake const &);
~Snake();
//
// Getters & Setters
//
public:
int getSize() const;
int getSpeed() const;
void setSpeed(int const);
void setGodMode();
//
// Display/Modify Snake
//
public:
void growUp(int const, int const, Map &);
void addSnakeInMap(Map &);
EventType move(EventType const, Map &);
EventType checkObject(Map &);
};
#endif /* !_SNAKE_HPP_ */