Skip to content
Snippets Groups Projects
Commit cbcc1b18 authored by Alfred Burgess's avatar Alfred Burgess
Browse files

Removed surpurfluous code from main and moved into the game engine

parent 47de9198
Branches
No related merge requests found
......@@ -12,6 +12,7 @@
#include "logger.h"
#include "entity-manager.h"
#include "game-state.h"
#include "scene.h"
#include "asset.h"
#include "save-manager.h"
......@@ -43,6 +44,7 @@ class GameEngine
void handleInput();
private:
SaveManager _saveManager;
GameState _state = Uninitialised;
size_t _frame = 0;
std::time_t _frametime = 0;
EntityManager _entityManager;
......
#ifndef __GAME_STATE__H__
#define __GAME_STATE__H__
enum GameState
{
Uninitialised,
......@@ -6,3 +8,5 @@ enum GameState
Active,
Exit
};
#endif // __GAME_STATE__H__
\ No newline at end of file
......@@ -15,6 +15,7 @@ void GameEngine::init()
{
this->isRunning = false;
this->_currScene = "";
this->_state = Initialise;
// this->_saveManager.list();
}
void GameEngine::changeScene( std::string label, Scene* scene )
......
......@@ -3,54 +3,15 @@
#ifndef __TEST_RUNNER__
int main( int argc, char* argv[] ) {
// const uint16_t SCREEN_HEIGHT = 600;
// const uint16_t SCREEN_WIDTH = 800;
// GameState state = Uninitialised;
// Initialise
Logger& logger = Logger::instance();
// SaveManager saveManager;
// state = Initialise;
// ConfigParser userSettings = ConfigParser::UserSettings();
// EntityManager entityManager;
// Seed the random number generator
srand(static_cast<unsigned int>(time(nullptr)));
// std::vector< Entity* > entities;
// Genrate a Random chunk
// WorldHex2D map( 5 );
//Chunk* chunk = new Chunk( 0, 0, 0);
//std::cout << chunk.getString() << std::endl;
// Chunk* chunk = map.getMidChunk();
// std::cout << chunk->getString() << std::endl;
// map.showChunk( 0, 0, 0 );
// map.moveInto( -2, 1, 1 );
// map.moveInto( -3, 2, 1 );
// map.moveInto( 5, -2, -3 )->visualise();
// map.visualise();
// Menu Loop
// List Saves
// saveManager.list();
GameEngine* game = new GameEngine();
game->run();
// userSettings.set( "exit", "teset" );
// std::cout << userSettings;
// Clean-up
// while( entities.size() > 0 )
// {
// Entity* entity = entities.back();
// entities.pop_back();
// delete entity;
// }
delete game;
// Return
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment