#include <Object.h>
Public Types | |
FIRST_ACTION = 1 | |
Never use this constant unless you need smallest usable value. | |
WAIT = FIRST_ACTION | |
Do nothing. | |
GO | |
Make one step. | |
TURN_LEFT | |
Turn left. | |
TURN_RIGHT | |
Turn right. | |
TURN_BACK | |
Turn back. | |
TAKE_OBJECT | |
Take object from it's place. | |
DROP_OBJECT | |
Drop carrying object. | |
EXPIRED_REMOVE | |
Object is no longer valid. | |
enum | Actions { FIRST_ACTION = 1, WAIT = FIRST_ACTION, GO, TURN_LEFT, TURN_RIGHT, TURN_BACK, TAKE_OBJECT, DROP_OBJECT, EXPIRED_REMOVE } |
Possible actions. More... | |
Public Member Functions | |
Action (Actions action=WAIT) | |
Default constructor. | |
Action (int action) | |
Constructor - creates action from int (config reasons). | |
~Action () | |
Destructor. | |
Actions | GetAction () const |
Returns current action. | |
void | SetAction (Actions newAction) |
Set new action. | |
Private Attributes | |
Actions | currentAction |
Current action. |
Note: Some of derived objects from Object are (of course) unable to perform specific actions, e.g. walls cannot move etc. but that's handled by virtual method SetAction().
Possible actions.
FIRST_ACTION | Never use this constant unless you need smallest usable value. |
WAIT | Do nothing. |
GO | Make one step. |
TURN_LEFT | Turn left. |
TURN_RIGHT | Turn right. |
TURN_BACK | Turn back. |
TAKE_OBJECT | Take object from it's place. |
DROP_OBJECT | Drop carrying object. |
EXPIRED_REMOVE | Object is no longer valid. |
Object::Action::Action | ( | Actions | action = WAIT |
) | [inline] |
Object::Action::Action | ( | int | action | ) | [inline, explicit] |
Object::Action::~Action | ( | ) | [inline] |
Destructor.
Actions Object::Action::GetAction | ( | ) | const [inline] |
Returns current action.
void Object::Action::SetAction | ( | Actions | newAction | ) | [inline] |
Set new action.
newAction | New action |
Actions Object::Action::currentAction [private] |
Current action.