Commit 529c6676 authored by Ilya Prokhorov's avatar Ilya Prokhorov

Empty scene test related code

parent 574857c3
......@@ -5,6 +5,7 @@
* Author: demensdeum
*/
#include <FlameSteelCore/FSCUtils.h>
#include "MainGameController.h"
#include <iostream>
......@@ -14,6 +15,7 @@
#endif
using namespace std;
using namespace FlameSteelCore::Utils;
using namespace FlameSteelEngine::GameToolkit;
MainGameController::MainGameController()
......@@ -190,7 +192,12 @@ void MainGameController::gameLoop()
void MainGameController::step()
{
this->currentController->step();
if (currentController.get() != nullptr) {
this->currentController->step();
}
else {
throwRuntimeException(string(" FlameSteelEngine::GameToolkit::MainGameController exception - current controller is null, state machine is not initialized?"));
}
}
......@@ -235,6 +242,9 @@ void MainGameController::setCurrentController(shared_ptr<GameController> newCurr
}
currentController = newCurrentController;
if (this->ioSystem.get() == nullptr) {
throwRuntimeException(string("FlameSteelEngineGameToolkit::MainGameController can't set current controller ioSystem is nullptr"));
}
currentController->setIOSystem(this->ioSystem);
currentController->setGameData(this->getGameData());
currentController->objectsContext = objectsContext;
......
......@@ -41,6 +41,7 @@ public:
void startGameFromState(int state);
void setIOSystem(shared_ptr<FSEGTIOSystem> ioSystem);
void switchToState(int state);
protected:
shared_ptr<ResourcesLoader> resourcesLoader;
......@@ -48,12 +49,10 @@ protected:
int state;
void switchToState(int state);
void setIsRunning(bool isRunning);
virtual void handleGameControllerMessage(shared_ptr<Message> message);
private:
map<int, shared_ptr<GameController> > stateToControllerMap;
shared_ptr<Message> gameControllerMessage;
......
......@@ -2,6 +2,7 @@
#define FLAMESTEELENGINEGAMETOOLKITIOSYSTEM_H_
#include <memory>
#include <FlameSteelCommonTraits/Screenshot.h>
#include <FlameSteelEngineGameToolkit/IO/Window/Window.h>
using namespace std;
......
......@@ -8,6 +8,7 @@
#ifndef FSEGTRENDERER_H_
#define FSEGTRENDERER_H_
#include <FlameSteelCommonTraits/Screenshot.h>
#include <FlameSteelCommonTraits/IOSystemParams.h>
#include <FlameSteelEngineGameToolkit/Data/FSEGTGameData.h>
#include <FlameSteelEngineGameToolkit/IO/IOSystems/FSEGTIOSystem.h>
......@@ -43,6 +44,8 @@ public:
virtual void addRenderID(int id);
virtual void cleanRenderIDs();
virtual shared_ptr<Screenshot> takeScreenshot() = 0;
};
#endif /* FSEGTRENDERER_H_ */
Markdown is supported
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