-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.hpp
45 lines (33 loc) · 888 Bytes
/
game.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
//
// Created by asuka on 09.03.2023.
//
# ifndef SNAKE_GAME_HPP
# define SNAKE_GAME_HPP
# include <keys_input.hpp>
# include <board.hpp>
# include <snake.hpp>
# include <snake_controller.hpp>
# include <apple.hpp>
namespace snake {
class Game {
public:
explicit Game(KeysInput keys_input);
~Game() = default;
Game(const Game&) = delete;
Game& operator=(const Game&) = delete;
Game(Game&&) noexcept = delete;
Game& operator=(Game&&) noexcept = delete;
void input();
void update();
Board& get_board();
Apple& get_apple();
Snake& get_snake();
private:
KeysInput keys_input_;
Board board_{};
Apple apple_{board_};
Snake snake_{board_, apple_, {5, 7}};
SnakeController snake_controller_{snake_};
};
} // snake
# endif // SNAKE_GAME_HPP