1#include "Game/LiveActor/ActorStateKeeper.hpp"
2#include "Game/LiveActor/Nerve.hpp"
4ActorStateKeeper::ActorStateKeeper(
int capacity)
5 : mStatesCapacity(capacity), mLength(0), mStates(NULL), mCurrentState(NULL) {
6 mStates =
new State [capacity];
7 for(s32 i = 0; i < mStatesCapacity; i++) {
15bool ActorStateKeeper::updateCurrentState() {
16 return (!mCurrentState) ? false : (mCurrentState->mInterface)->update();
19void ActorStateKeeper::startState(
const Nerve *pNerve) {
20 mCurrentState = findStateInfo(pNerve);
28void ActorStateKeeper::endState(
const Nerve *pNerve) {
29 mCurrentState = findStateInfo(pNerve);
33 if (!interface->mIsDead) {
40 State& e = mStates[mLength];
41 e.mInterface = pInterface;
48 for(
int i = 0; i < mLength; i++) {
49 if(mStates[i].mNerve == pNerve)
return &mStates[i];
Used for executing states of a LiveActor.