From 18c7bede5b86234116a76fd6571e190b1eb9e711 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 9 Jan 2012 18:40:29 -0700 Subject: Actually works with windows now. --- src/interfaceconsole.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/interfaceconsole.cpp') diff --git a/src/interfaceconsole.cpp b/src/interfaceconsole.cpp index 05ca56c..b30733a 100644 --- a/src/interfaceconsole.cpp +++ b/src/interfaceconsole.cpp @@ -1,6 +1,7 @@ #include "interfaceconsole.h" #include "smlnode.h" +#include "gamestate.h" #include @@ -19,6 +20,21 @@ InterfaceConsole::~InterfaceConsole() { } +void InterfaceConsole::run( Game *pGame ) +{ + GameState gs( pGame ); + gs.init(); + + while( gs.isRunning() ) + { + char buf[1024]; + sio << sio.nl << "command> " << sio.flush; + fgets( buf, 1024, stdin ); + + gs.execCommand( buf ); + } +} + void InterfaceConsole::appendToken( Bu::String &sCurLine, Bu::String &sNextToken, int &iLineLen, int &iNextLen ) { -- cgit v1.2.3