2023-04-06 19:27:10 -05:00
|
|
|
#ifndef PLAYERINTERFACE_HPP
|
|
|
|
#define PLAYERINTERFACE_HPP
|
|
|
|
|
|
|
|
#include "common.hpp"
|
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
|
|
|
|
const int kGridSize = 25;
|
|
|
|
|
|
|
|
namespace snakeplusplus
|
|
|
|
{
|
2023-08-14 17:39:04 -05:00
|
|
|
PlayerDirection GetPlayerInput(void);
|
2023-04-06 19:27:10 -05:00
|
|
|
|
2023-04-06 22:22:06 -05:00
|
|
|
class PlayerOutput
|
2023-04-06 19:27:10 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
sf::Vector2f gameBoundaries;
|
2023-04-06 22:22:06 -05:00
|
|
|
PlayerOutput(void);
|
2023-04-06 19:27:10 -05:00
|
|
|
bool IsOpen(void);
|
|
|
|
void CheckContinue(void);
|
2023-04-15 05:15:11 -05:00
|
|
|
void DisplayGameState(std::vector< std::vector<char> >& gameBoard);
|
2023-04-06 19:27:10 -05:00
|
|
|
void StartGameWindow(void);
|
|
|
|
private:
|
|
|
|
void CheckWindowEvents(void);
|
2023-04-06 22:22:06 -05:00
|
|
|
void DisplayEndScreen(void);
|
2023-04-06 19:27:10 -05:00
|
|
|
void DrawEmpty(sf::Vector2f location);
|
|
|
|
void DrawFood(sf::Vector2f location);
|
|
|
|
void DrawSnake(sf::Vector2f location);
|
|
|
|
sf::RenderWindow gameWindow;
|
|
|
|
sf::VideoMode gameVideoSettings;
|
|
|
|
sf::RectangleShape drawObject;
|
2023-04-06 22:22:06 -05:00
|
|
|
bool isWindowAlive;
|
2023-08-19 12:56:40 -05:00
|
|
|
sf::Time delay = sf::milliseconds(20);
|
2023-04-06 19:27:10 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|