#include "interfaceconsole.h" #include "smlnode.h" #include "gamestate.h" #include #include #include "smlrenderervt100.h" #include #include #include PluginInterface3( plugin_interface_console, console, InterfaceConsole, Interface, "Mike Buland", 1, 0 ); using namespace Bu; InterfaceConsole::InterfaceConsole() { } InterfaceConsole::~InterfaceConsole() { } void InterfaceConsole::run( Game *pGame ) { GameState gs( pGame, this ); gs.init(); int iStep = 0; while( gs.isRunning() ) { char buf[1024]; sio << sio.nl << "command> " << sio.flush; fgets( buf, 1024, stdin ); gs.execCommand( buf ); Gats::Object *pObj = gs.toGats(); File fOut( Bu::String("test-%1.save").arg( iStep++ ), File::WriteNew ); Gats::GatsStream gs( fOut ); gs.writeObject( pObj ); delete pObj; } } void InterfaceConsole::display( const class SmlNode *pSml ) { SmlRendererVt100 rend; rend.render( sio, pSml ); }