Cleaned up naming of files; setup more structure
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#ifndef DISPLAY_H
|
||||
#define DISPLAY_H
|
||||
|
||||
class DisplayInterface
|
||||
{
|
||||
public:
|
||||
DisplayInterface(void);
|
||||
protected:
|
||||
virtual void DisplayGameState(void) = 0;
|
||||
private:
|
||||
;
|
||||
};
|
||||
|
||||
class CommandLine : public DisplayInterface
|
||||
{
|
||||
public:
|
||||
CommandLine(void) = default;
|
||||
void DisplayGameState(void);
|
||||
protected:
|
||||
;
|
||||
private:
|
||||
;
|
||||
};
|
||||
|
||||
class GameWindow : public DisplayInterface
|
||||
{
|
||||
public:
|
||||
GameWindow(void) = default;
|
||||
void DisplayGameState(void);
|
||||
protected:
|
||||
;
|
||||
private:
|
||||
;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2,12 +2,16 @@
|
||||
#ifndef GAMESTATE_H
|
||||
#define GAMESTATE_H
|
||||
|
||||
#include <memory>
|
||||
#include <SFML\Graphics.hpp>
|
||||
#include "Snake.h"
|
||||
#include "snake.h"
|
||||
#include "display.h"
|
||||
|
||||
class GameState
|
||||
{
|
||||
public:
|
||||
std::vector< std::vector<char> > gameBoard;
|
||||
bool useSFML = 1;
|
||||
GameState();
|
||||
GameState(int newHorizontal, int newVertical);
|
||||
void StartGame(void);
|
||||
@@ -15,6 +19,7 @@ public:
|
||||
protected:
|
||||
;
|
||||
private:
|
||||
std::unique_ptr<DisplayInterface> graphics;
|
||||
sf::RenderWindow gameWindow;
|
||||
sf::VideoMode gameVideoSettings;
|
||||
SnakeFood playerFood;
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <deque>
|
||||
#include <SFML\Graphics.hpp>
|
||||
#include "SnakeFood.h"
|
||||
#include "snakefood.h"
|
||||
|
||||
|
||||
class Snake
|
||||
@@ -17,7 +17,6 @@ public:
|
||||
sf::Vector2f GetSnakeHeadPosition(void);
|
||||
bool IsTouchingObject(sf::RectangleShape object);
|
||||
void MoveSnake(SnakeFood* playerFood);
|
||||
void Reset(void);
|
||||
void UpdateDirection(int newDirection);
|
||||
protected:
|
||||
;
|
||||
Reference in New Issue
Block a user