summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-02-05 16:37:36 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-02-05 16:37:36 (GMT)
commit7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90 (patch)
treeb76fc14cca5e19c5482209f34131973ad1f80e6a /src/game
parent8024caec55ff1b93eefe50663d4ddf63934f8d63 (diff)
downloadpowder-7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90.zip
powder-7ae5eaab79a41f31b633ca6f1bfb0dbae2fccb90.tar.gz
Started intrepreter for tpt script and various things for console
Diffstat (limited to 'src/game')
-rw-r--r--src/game/GameController.cpp9
-rw-r--r--src/game/GameController.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp
index 7df654f..73e59a5 100644
--- a/src/game/GameController.cpp
+++ b/src/game/GameController.cpp
@@ -70,7 +70,8 @@ GameController::GameController():
search(NULL),
renderOptions(NULL),
loginWindow(NULL),
- ssave(NULL)
+ ssave(NULL),
+ console(NULL)
{
gameView = new GameView();
gameModel = new GameModel();
@@ -78,6 +79,9 @@ GameController::GameController():
gameView->AttachController(this);
gameModel->AddObserver(gameView);
+ commandInterface = new TPTScriptInterface();
+ commandInterface->AttachGameModel(gameModel);
+
//sim = new Simulation();
}
@@ -312,7 +316,8 @@ void GameController::OpenDisplayOptions()
void GameController::ShowConsole()
{
- console = new ConsoleController(NULL);
+ if(!console)
+ console = new ConsoleController(NULL, commandInterface);
ui::Engine::Ref().ShowWindow(console->GetView());
}
diff --git a/src/game/GameController.h b/src/game/GameController.h
index 0e70371..ba3ae70 100644
--- a/src/game/GameController.h
+++ b/src/game/GameController.h
@@ -11,12 +11,15 @@
#include "login/LoginController.h"
#include "ssave/SSaveController.h"
#include "console/ConsoleController.h"
+#include "cat/TPTScriptInterface.h"
#include "Menu.h"
using namespace std;
class GameModel;
class GameView;
+class CommandInterface;
+class ConsoleController;
class GameController
{
private:
@@ -28,6 +31,7 @@ private:
LoginController * loginWindow;
SSaveController * ssave;
ConsoleController * console;
+ CommandInterface * commandInterface;
public:
class LoginCallback;
class SearchCallback;