forked from KMUlee/SnakeGameWithCPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnake.hpp
More file actions
48 lines (40 loc) · 812 Bytes
/
Snake.hpp
File metadata and controls
48 lines (40 loc) · 812 Bytes
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
//
// Snake.hpp
// cpp_algo
//
// Created by 이승원 on 2022/04/29.
//
#ifndef Snake_hpp
#define Snake_hpp
#include <stdio.h>
#include <stdlib.h>
#include "SnakeBody.hpp"
class Snake {
private:
int top, dir_x, dir_y;
SnakeBody *snakeBody;
public:
//constructor
Snake(int num);
//getter
int getTop();
int getDirX();
int getDirY();
SnakeBody* getSnakeBody();
void getHeadPos(int *x, int *y);
void getSnakePos(int num, int *x, int *y);
//setter
void setTop(int top);
void setDirection(int x, int y);
void setHeadPos(int x, int y);
//push
void snakePush(int x, int y, char* shape);
//pop
void snakePop();
//event
void snakeMove();
int eventDeath();
//test
void test();
};
#endif /* Snake_hpp */