Commit 2a639a9e authored by Ilya Prokhorov's avatar Ilya Prokhorov

Great cleanup

parent 74435cd4
#include "FSEGTFreeCameraControllerDelegate.h"
void FSEGTFreeCameraControllerDelegate::freeCameraControllerDidUpdateCamera(shared_ptr<FSEGTFreeCameraController> freeCameraController, shared_ptr<Object> camera)
{
}
\ No newline at end of file
......@@ -18,8 +18,8 @@ class FSEGTFreeCameraControllerDelegate
{
public:
virtual void freeCameraControllerDidUpdateCamera(shared_ptr<FSEGTFreeCameraController> freeCameraController, shared_ptr<Object> camera);
virtual void freeCameraControllerDidUpdateCamera(shared_ptr<FSEGTFreeCameraController> freeCameraController, shared_ptr<Object> camera) = 0;
};
#endif
\ No newline at end of file
#endif
......@@ -59,13 +59,6 @@ void GameController::receivedActionFromSender(int, Object *)
}
void GameController::controllerDidFinish(Controller *controller, shared_ptr<string> message)
{
throw logic_error("unhandled empty controller did finish notify");
}
void GameController::notifyListenerAboutControllerDidFinish(GameController *gameController, shared_ptr<string> message)
{
if (listener)
......@@ -128,4 +121,4 @@ void GameController::setIOSystem(shared_ptr<FSEGTIOSystem> ioSystem)
GameController::~GameController()
{
// TODO Auto-generated destructor stub
}
\ No newline at end of file
}
......@@ -52,9 +52,8 @@ public:
void setIOSystem(shared_ptr<FSEGTIOSystem> ioSystem);
// listener
GameController *listener;
virtual void controllerDidFinish(Controller *controller, shared_ptr<string> message);
virtual void controllerDidFinish(Controller *controller, shared_ptr<string> message) = 0;
virtual void receivedActionFromSender(int action, Object *sender);
......
#include "Action.h"
using namespace FlameSteelEngine::GameToolkit;
Action::Action(shared_ptr<string> instanceIdentifier, shared_ptr<Script> script, weak_ptr<ScriptEngine> scriptEngine)
{
setInstanceIdentifier(instanceIdentifier);
if (script.get() == nullptr)
{
throw logic_error("Can't set script in action constructor - script is null");
}
this->script = script;
this->scriptEngine = scriptEngine;
}
void Action::step()
{
auto lockedScriptEngine = scriptEngine.lock();
if (lockedScriptEngine.get() == nullptr)
{
throw logic_error("Trying to call freed script engine");
}
lockedScriptEngine->step(script);
}
\ No newline at end of file
#ifndef FSEGTACTION_H_
#define FSEGTACTION_H_
#include "Script.h"
#include <FlameSteelEngineGameToolkit/ScriptEngine/ScriptEngine.h>
#include <FlameSteelCore/Object.h>
#include <memory>
#include <string>
using namespace FlameSteelCore;
using namespace std;
namespace FlameSteelEngine
{
namespace GameToolkit
{
class Action: Object
{
public:
Action(shared_ptr<string> instanceIdentifier, shared_ptr<Script> script, weak_ptr<ScriptEngine> scriptEngine);
virtual void step();
private:
shared_ptr<Script> script;
weak_ptr<ScriptEngine> scriptEngine;
};
};
};
#endif
\ No newline at end of file
#include "Script.h"
using namespace FlameSteelEngine::GameToolkit;
Script::Script(shared_ptr<string> script)
{
}
\ No newline at end of file
#ifndef FSEGTSCRIPT_H_
#define FSEGTSCRIPT_H_
#include <memory>
#include <string>
using namespace std;
namespace FlameSteelEngine
{
namespace GameToolkit
{
class Script
{
public:
Script(shared_ptr<string> source);
shared_ptr<string> source;
};
};
};
#endif
\ No newline at end of file
......@@ -23,16 +23,6 @@ void FSEGTIOSystem::preInitialize()
}
void FSEGTIOSystem::initialize(shared_ptr<IOSystemParams> )
{
}
void FSEGTIOSystem::fillParams(shared_ptr<IOSystemParams> params)
{
}
void FSEGTIOSystem::stop()
{
......
......@@ -31,8 +31,8 @@ public:
FSEGTIOSystem();
virtual void preInitialize();
virtual void fillParams(shared_ptr<IOSystemParams> params = nullptr);
virtual void initialize(shared_ptr<IOSystemParams> params = nullptr);
virtual void fillParams(shared_ptr<IOSystemParams> params = nullptr) = 0;
virtual void initialize(shared_ptr<IOSystemParams> params = nullptr) = 0;
virtual void clearCache();
......
......@@ -18,15 +18,6 @@ void FSEGTRenderer::preInitialize()
{
}
void FSEGTRenderer::fillParams(shared_ptr<IOSystemParams> params)
{
}
void FSEGTRenderer::initializeWindow(shared_ptr<IOSystemParams> params)
{
}
void FSEGTRenderer::render(shared_ptr<FSEGTGameData> )
{
......@@ -45,18 +36,6 @@ void FSEGTRenderer::blankScreen()
void FSEGTRenderer::updateScreen()
{
}
void FSEGTRenderer::objectsContextObjectAdded(shared_ptr<FSEGTObjectsContext>, shared_ptr<Object> )
{
}
void FSEGTRenderer::addRenderID(int )
{
}
void FSEGTRenderer::cleanRenderIDs()
......@@ -69,4 +48,4 @@ void FSEGTRenderer::cleanRenderIDs()
FSEGTRenderer::~FSEGTRenderer()
{
// TODO Auto-generated destructor stub
}
\ No newline at end of file
}
......@@ -24,10 +24,10 @@ public:
FSEGTRenderer();
virtual void preInitialize();
virtual void fillParams(shared_ptr<IOSystemParams> params);
virtual void initializeWindow(shared_ptr<IOSystemParams> params);
virtual void fillParams(shared_ptr<IOSystemParams> params) = 0;
virtual void initializeWindow(shared_ptr<IOSystemParams> params) = 0;
virtual void render(shared_ptr<FSEGTGameData> gameData);
virtual void render(shared_ptr<FSEGTGameData> gameData) = 0;
virtual void beforeStop();
......@@ -39,9 +39,9 @@ public:
virtual ~FSEGTRenderer();
virtual void objectsContextObjectAdded(shared_ptr<FSEGTObjectsContext> context, shared_ptr<Object> object);
virtual void objectsContextObjectAdded(shared_ptr<FSEGTObjectsContext> context, shared_ptr<Object> object) = 0;
virtual void addRenderID(int id);
//virtual void addRenderID(int id) = 0;
virtual void cleanRenderIDs();
......
#include "ScriptEngine.h"
using namespace FlameSteelEngine::GameToolkit;
void ScriptEngine::step(shared_ptr<Script> script)
{
}
\ No newline at end of file
#ifndef FSEGTSCRIPTENGINE_H_
#define FSEGTSCRIPTENGINE_H_
#include <memory>
#include <string>
#include <FlameSteelEngineGameToolkit/Data/Action/Script.h>
using namespace FlameSteelEngine::GameToolkit;
class ScriptEngine
{
public:
void step(shared_ptr<Script> script);
};
#endif
\ No newline at end of file
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