From 19e2b8cae9c66a6c971fa088642bec739067c7ad Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 6 Feb 2012 01:27:41 -0700 Subject: Option input type works now. --- src/commandset.cpp | 6 ++++++ src/commandset.h | 1 + src/situation.cpp | 1 + 3 files changed, 8 insertions(+) diff --git a/src/commandset.cpp b/src/commandset.cpp index a125541..c2231d5 100644 --- a/src/commandset.cpp +++ b/src/commandset.cpp @@ -36,3 +36,9 @@ bool CommandSet::dispatch( class GameState &gState, const Bu::StringList &lCmd ) return false; } +void CommandSet::exec( class GameState &gState, int idx ) +{ + CommandList::iterator i = lCommand.begin()+idx; + (*i)->exec( gState, Bu::StringList() ); +} + diff --git a/src/commandset.h b/src/commandset.h index aff2e4c..d7094f0 100644 --- a/src/commandset.h +++ b/src/commandset.h @@ -13,6 +13,7 @@ public: void addCommand( class Command *pCmd ); bool dispatch( class GameState &gState, const Bu::StringList &lCmd ); + void exec( class GameState &gState, int idx ); typedef Bu::List CommandList; const CommandList &getCommandList() const { return lCommand; } diff --git a/src/situation.cpp b/src/situation.cpp index 54096cc..923eea7 100644 --- a/src/situation.cpp +++ b/src/situation.cpp @@ -62,6 +62,7 @@ bool Situation::execCommand( class GameState &gState, void Situation::execOption( class GameState &gState, int idx ) { + csLocal.exec( gState, idx ); } Bu::Formatter &operator<<( Bu::Formatter &f, Situation::Mode m ) -- cgit v1.2.3