You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
450 B
30 lines
450 B
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "../input-output/Graphics.h"
|
|
#include "../components/Snake.h"
|
|
#include "../components/Point.h"
|
|
|
|
static constexpr int DEFEAT = -1;
|
|
|
|
class Controller {
|
|
private:
|
|
Snake snake_;
|
|
Point snack_;
|
|
|
|
int input_;
|
|
uint32_t score_;
|
|
|
|
void printScore(uint32_t score) const;
|
|
void readInput();
|
|
|
|
public:
|
|
Controller();
|
|
|
|
int act();
|
|
|
|
bool wantsToQuit() const;
|
|
|
|
uint32_t getScore() const;
|
|
};
|