summaryrefslogtreecommitdiff
path: root/src/interfaceconsole.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-01-09 18:40:29 -0700
committerMike Buland <eichlan@xagasoft.com>2012-01-09 18:40:29 -0700
commit18c7bede5b86234116a76fd6571e190b1eb9e711 (patch)
treec675039b6ea29bc8ff706146072e23fdd89a6733 /src/interfaceconsole.cpp
parentbe0230eb9ff1b08e45d79a28d39c0feea7869673 (diff)
downloadstage-18c7bede5b86234116a76fd6571e190b1eb9e711.tar.gz
stage-18c7bede5b86234116a76fd6571e190b1eb9e711.tar.bz2
stage-18c7bede5b86234116a76fd6571e190b1eb9e711.tar.xz
stage-18c7bede5b86234116a76fd6571e190b1eb9e711.zip
Actually works with windows now.
Diffstat (limited to 'src/interfaceconsole.cpp')
-rw-r--r--src/interfaceconsole.cpp16
1 files changed, 16 insertions, 0 deletions
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 @@
1#include "interfaceconsole.h" 1#include "interfaceconsole.h"
2 2
3#include "smlnode.h" 3#include "smlnode.h"
4#include "gamestate.h"
4 5
5#include <bu/sio.h> 6#include <bu/sio.h>
6 7
@@ -19,6 +20,21 @@ InterfaceConsole::~InterfaceConsole()
19{ 20{
20} 21}
21 22
23void InterfaceConsole::run( Game *pGame )
24{
25 GameState gs( pGame );
26 gs.init();
27
28 while( gs.isRunning() )
29 {
30 char buf[1024];
31 sio << sio.nl << "command> " << sio.flush;
32 fgets( buf, 1024, stdin );
33
34 gs.execCommand( buf );
35 }
36}
37
22void InterfaceConsole::appendToken( Bu::String &sCurLine, 38void InterfaceConsole::appendToken( Bu::String &sCurLine,
23 Bu::String &sNextToken, int &iLineLen, int &iNextLen ) 39 Bu::String &sNextToken, int &iLineLen, int &iNextLen )
24{ 40{