#include <cController.h>
Public Types | |
enum | Opcodes { WAIT, ATTACK, FOLLOW, GOTO, REPEAT, OPCODE_MAX } |
Available opcodes of stack-machine. | |
Public Member Functions | |
cController (cObject *entity, bool enabled=true) | |
Initialises a en-/disabled controller for the given entity->. | |
void | process (float spf=1.0f) |
Do a single Instruction step as the top frame on the stack says. | |
void | drawHUD () |
Currently there is no hud but needed to implement cComputer interface. | |
void | printState () |
Print out State and Stackinformation. | |
void | pushWaitEvent (long mseconds=-1, bool patrol=true) |
void | waitEvent () |
void | pushAttackEnemy (OID entity) |
void | attackEnemy () |
void | pushFollowLeader (OID entity, bool patrol=true) |
void | followLeader () |
void | pushGotoDestination (float *v, bool patrol=true) |
void | gotoDestination () |
void | pushRepeatInstructions (int n) |
void | repeatInstructions () |
Public Attributes | |
bool | mEnabled |
cObject * | mDevice |
std::vector< OID > | mStack |
Protected Member Functions | |
std::string | getFrameName () |
unsigned int | getFrameSizeOf (int opcode) |
unsigned int | getFrameSize () |
void | setParameter (int offset, OID value) |
OID | getParameter (int offset) |
void | push (OID value) |
void | pop () |
Autopilot/AI object controller, controlls usualy Mechs. Implements an stack-automaton for object behavior control and plan execution.