aboutsummaryrefslogtreecommitdiff
path: root/src/action.cpp
blob: cae4f014d2e15218c2df20c97e19c2f3873293c2 (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"

Action::Action()
{
}

Action::~Action()
{
}

void Action::addCommand( eAction act, const std::string &sWhat )
{
	lCmds.push_back( Cmd( act, sWhat ) );
}

void Action::begin()
{
	i = lCmds.begin();
}

bool Action::isEnded()
{
	return i == lCmds.end();
}

void Action::next()
{
	i++;
}

Action::eAction Action::getAct()
{
	return (*i).act;
}

std::string Action::getWhat()
{
	return (*i).sWhat;
}

void Action::setMode( eAction nAct )
{
	for( CmdList::iterator j = lCmds.begin(); j != lCmds.end(); j++ )
	{
		(*j).act = nAct;
	}
}