diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-01-09 18:40:29 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-01-09 18:40:29 -0700 |
commit | 18c7bede5b86234116a76fd6571e190b1eb9e711 (patch) | |
tree | c675039b6ea29bc8ff706146072e23fdd89a6733 /src/interfaceconsole.cpp | |
parent | be0230eb9ff1b08e45d79a28d39c0feea7869673 (diff) | |
download | stage-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.cpp | 16 |
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 | ||
23 | void 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 | |||
22 | void InterfaceConsole::appendToken( Bu::String &sCurLine, | 38 | void InterfaceConsole::appendToken( Bu::String &sCurLine, |
23 | Bu::String &sNextToken, int &iLineLen, int &iNextLen ) | 39 | Bu::String &sNextToken, int &iLineLen, int &iNextLen ) |
24 | { | 40 | { |