summaryrefslogtreecommitdiff
path: root/src/commandset.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commandset.cpp')
-rw-r--r--src/commandset.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/commandset.cpp b/src/commandset.cpp
index ffd58a5..a125541 100644
--- a/src/commandset.cpp
+++ b/src/commandset.cpp
@@ -2,6 +2,9 @@
2 2
3#include "command.h" 3#include "command.h"
4 4
5#include <bu/sio.h>
6using namespace Bu;
7
5CommandSet::CommandSet() 8CommandSet::CommandSet()
6{ 9{
7} 10}
@@ -19,3 +22,17 @@ void CommandSet::addCommand( class Command *pCmd )
19 lCommand.append( pCmd ); 22 lCommand.append( pCmd );
20} 23}
21 24
25bool CommandSet::dispatch( class GameState &gState, const Bu::StringList &lCmd )
26{
27 for( CommandList::iterator i = lCommand.begin(); i; i++ )
28 {
29 if( (*i)->matches( lCmd ) )
30 {
31 (*i)->exec( gState, lCmd );
32 return true;
33 }
34 }
35
36 return false;
37}
38