#include "gamebuilder.h" #include "game.h" #include "gamestate.h" #include "parser.tab.h" #include #include #ifdef WIN32 #define srandom( x ) srand( x ) #endif #include using namespace Bu; typedef void *yyscan_t; void yylex_init( yyscan_t * ); void yylex_destroy( yyscan_t ); void yyparse( yyscan_t, GameBuilder &bld ); void yyset_in( FILE *, yyscan_t ); int main( int argc, char *argv[] ) { yyscan_t scanner; GameBuilder bld; yylex_init( &scanner ); FILE *in = fopen( argv[1], "rb" ); yyset_in( in, scanner ); yyparse( scanner, bld ); yylex_destroy( scanner ); fclose( in ); srandom( time( NULL ) ); Game *pGame = bld.getGame(); GameState gs( pGame ); gs.init(); while( gs.isRunning() ) { char buf[1024]; sio << sio.nl << "command> " << sio.flush; fgets( buf, 1024, stdin ); gs.execCommand( buf ); } return 0; }