2022-07-28 15:18:24 -05:00
|
|
|
// GameState.h
|
|
|
|
#ifndef GAMESTATE_H
|
|
|
|
#define GAMESTATE_H
|
2023-03-12 08:50:50 -05:00
|
|
|
|
2023-03-13 21:10:52 -05:00
|
|
|
#include <memory>
|
2023-03-17 17:27:02 -05:00
|
|
|
#include <SFML/Graphics.hpp>
|
2023-03-13 21:10:52 -05:00
|
|
|
#include "snake.h"
|
2023-03-17 20:13:50 -05:00
|
|
|
#include "snakefood.h"
|
2023-03-13 21:10:52 -05:00
|
|
|
#include "display.h"
|
2022-07-28 15:18:24 -05:00
|
|
|
|
|
|
|
class GameState
|
|
|
|
{
|
|
|
|
public:
|
2022-08-02 21:17:23 -05:00
|
|
|
GameState();
|
2023-03-17 20:13:50 -05:00
|
|
|
void SetGameSettings(int argc, char* argv[]);
|
2023-03-12 08:50:50 -05:00
|
|
|
void StartGame(void);
|
|
|
|
sf::Vector2f GetGameBoundaries(void);
|
|
|
|
protected:
|
|
|
|
;
|
|
|
|
private:
|
2023-03-17 20:13:50 -05:00
|
|
|
std::vector< std::vector<char> > gameBoard;
|
2023-03-13 21:10:52 -05:00
|
|
|
std::unique_ptr<DisplayInterface> graphics;
|
2023-03-12 08:50:50 -05:00
|
|
|
Snake player;
|
2023-03-17 20:13:50 -05:00
|
|
|
SnakeFood playerFood;
|
|
|
|
bool useSFML = 1;
|
|
|
|
void ApplySettings(void);
|
2023-03-13 08:24:56 -05:00
|
|
|
void DisplayEndScreen(void);
|
2023-03-12 21:57:46 -05:00
|
|
|
void GetKeyboardInput(void);
|
2023-03-13 08:24:56 -05:00
|
|
|
bool PlayerWantsToContinue(void);
|
2023-03-12 08:50:50 -05:00
|
|
|
void RegenerateFood(void);
|
2023-03-17 17:27:02 -05:00
|
|
|
void ResetGameBoard(void);
|
2023-03-12 08:50:50 -05:00
|
|
|
void RunGameLoop(void);
|
|
|
|
void RenderWindow(void);
|
2022-07-28 15:18:24 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|