aboutsummaryrefslogtreecommitdiff
path: root/src/action.cpp
blob: 8907816eef48d2f7e048d49a8fc86cf8397c4c66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "action.h"
#include "command.h"
#include "builder.h"

Action::Action() :
	bDefault( true ),
	sName("")
{
}

Action::Action( const char *sName ) :
	bDefault( false ),
	sName( sName )
{
}

Action::~Action()
{
}

void Action::add( Command *pCmd )
{
	lCommand.push_back( pCmd );
}

void Action::debug()
{
	if( bDefault )
		printf("   action default:\n");
	else
		printf("   action \"%s\":\n", sName.getString() );

	for( std::list<Command *>::iterator i = lCommand.begin();
		 i != lCommand.end(); i++ )
	{
		(*i)->debug();
	}
}

void Action::execute( Builder &bld )
{
	for( std::list<Command *>::iterator i = lCommand.begin();
		 i != lCommand.end(); i++ )
	{
		(*i)->execute( bld );
	}
}