#include "game.h" #include "functiondisplay.h" #include "functionexists.h" #include "functiondelete.h" Game::Game() { addFunction( new FunctionDisplay() ); addFunction( new FunctionExists() ); addFunction( new FunctionDelete() ); } Game::~Game() { for( FunctionHash::iterator i = hFunction.begin(); i; i++ ) { delete (*i); } for( SituationHash::iterator i = hSituation.begin(); i; i++ ) { delete (*i); } } Function *Game::getFunction( const Bu::String &sName ) { return hFunction.get( sName ); } Variable Game::getParam( const Bu::String &sName ) const { return hGlobalParam.get( sName ); } Situation *Game::getSituation( const Bu::String &sName ) { return hSituation.get( sName ); } bool Game::execCommand( class GameState &gState, const Bu::StringList &lCmd ) { return csGlobal.dispatch( gState, lCmd ); } void Game::addFunction( Function *pFunc ) { hFunction.insert( pFunc->getName(), pFunc ); }