snakeplusplus/include/gamestate.h

37 lines
780 B
C
Raw Normal View History

// GameState.h
#ifndef GAMESTATE_H
#define GAMESTATE_H
2023-03-12 08:50:50 -05:00
#include <memory>
#include <SFML/Graphics.hpp>
#include "snake.h"
2023-03-17 20:13:50 -05:00
#include "snakefood.h"
#include "display.h"
class GameState
{
public:
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;
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);
void DisplayEndScreen(void);
void GetKeyboardInput(void);
bool PlayerWantsToContinue(void);
2023-03-12 08:50:50 -05:00
void RegenerateFood(void);
void ResetGameBoard(void);
2023-03-12 08:50:50 -05:00
void RunGameLoop(void);
void RenderWindow(void);
};
#endif