diff options
Diffstat (limited to 'src/action.cpp')
| -rw-r--r-- | src/action.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/action.cpp b/src/action.cpp new file mode 100644 index 0000000..7a7bbb8 --- /dev/null +++ b/src/action.cpp | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #include "action.h" | ||
| 2 | #include "command.h" | ||
| 3 | |||
| 4 | Action::Action() : | ||
| 5 | bDefault( true ), | ||
| 6 | sName("") | ||
| 7 | { | ||
| 8 | } | ||
| 9 | |||
| 10 | Action::Action( const char *sName ) : | ||
| 11 | bDefault( false ), | ||
| 12 | sName( sName ) | ||
| 13 | { | ||
| 14 | } | ||
| 15 | |||
| 16 | Action::~Action() | ||
| 17 | { | ||
| 18 | } | ||
| 19 | |||
| 20 | void Action::add( Command *pCmd ) | ||
| 21 | { | ||
| 22 | lCommand.push_back( pCmd ); | ||
| 23 | } | ||
| 24 | |||
| 25 | void Action::debug() | ||
| 26 | { | ||
| 27 | if( bDefault ) | ||
| 28 | printf("action default:\n"); | ||
| 29 | else | ||
| 30 | printf("action \"%s\":\n", sName.getString() ); | ||
| 31 | |||
| 32 | for( std::list<Command *>::iterator i = lCommand.begin(); | ||
| 33 | i != lCommand.end(); i++ ) | ||
| 34 | { | ||
| 35 | (*i)->debug(); | ||
| 36 | } | ||
| 37 | } | ||
| 38 | |||
