summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 262e7c4..9df79a4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,6 +3,8 @@
3#include "gamestate.h" 3#include "gamestate.h"
4#include "options.h" 4#include "options.h"
5 5
6#include "interfaceplugger.h"
7
6#include <stdlib.h> 8#include <stdlib.h>
7#include <time.h> 9#include <time.h>
8 10
@@ -25,21 +27,19 @@ int main( int argc, char *argv[] )
25 } 27 }
26 srandom( time( NULL ) ); 28 srandom( time( NULL ) );
27 29
30 Interface *pIface = InterfacePlugger::getInstance().instantiate(
31 opt.sInterface
32 );
33
28 GameBuilder bld; 34 GameBuilder bld;
29 bld.parse( opt.sFile ); 35 bld.parse( opt.sFile );
30 Game *pGame = bld.getGame(); 36 Game *pGame = bld.getGame();
31 37
32 GameState gs( pGame ); 38 pIface->run( pGame );
33 gs.init();
34 39
35 while( gs.isRunning() ) 40 delete pGame;
36 {
37 char buf[1024];
38 sio << sio.nl << "command> " << sio.flush;
39 fgets( buf, 1024, stdin );
40 41
41 gs.execCommand( buf ); 42 InterfacePlugger::getInstance().destroy( pIface );
42 }
43 43
44 return 0; 44 return 0;
45} 45}