IStateManager Class Reference

State manager class. Inherit from this class and create some states to give your agents FSM functionality. More...

#include <ceStateCore.h>

Collaboration diagram for IStateManager:

List of all members.

Public Member Functions

const short VerifyStateManager (void) const
 Verify the integrity of the manager class.
void SetGlobalState (IState *State) const
 Set a global state that will be called every time the FSM is updated.
IStateGetGlobalState (void) const
 Get the global state in use.
void SetCurrentState (IState *State) const
 Set a current state that will be called every time the FSM is updated.
IStateGetCurrentState (void) const
 Get the current state in use.
void SetPreviousState (IState *State) const
 Set a previous state.
IStateGetPreviousState (void) const
 Get the previous state.
void Update (void) const
 This function will trigger update on the global state the current state.
void ChangeState (IState *State) const
 Change to a new current state.
void RevertToPreviousState (void) const
 Change back the current state to the previous state.
short IsInState (const IState &State) const
 Check if state is equal to the current state in use of the FSM.
const IStateManageroperator-> (void) const

Protected Attributes

IStateGlobalState
 This state logic is called every time the FSM is updated.
IStateCurrentState
 A pointer to an instance of a current state.
IStatePreviousState
 A record of the last current state the agent was in.

Detailed Description

State manager class. Inherit from this class and create some states to give your agents FSM functionality.


Member Function Documentation

const short VerifyStateManager ( void   )  const [inline]

Verify the integrity of the manager class.

Returns:
TRUE if everything is ok or FALSE in case of some error.
void SetGlobalState ( IState State  )  const [inline]

Set a global state that will be called every time the FSM is updated.

Parameters:
State A state that will be the global state or also the null state instance (ce::NullState) or also the NULL value.
IState* GetGlobalState ( void   )  const [inline]

Get the global state in use.

Returns:
IState A pointer to the global state in use.
void SetCurrentState ( IState State  )  const [inline]

Set a current state that will be called every time the FSM is updated.

Parameters:
State A state that will be the current state or also the null state instance (ce::NullState) or also the NULL value.
IState* GetCurrentState ( void   )  const [inline]

Get the current state in use.

Returns:
IState A pointer to the current state in use.
void SetPreviousState ( IState State  )  const [inline]

Set a previous state.

Parameters:
State A state that will be the global state or also the null state instance (ce::NullState) or also the NULL value.
IState* GetPreviousState ( void   )  const [inline]

Get the previous state.

Returns:
IState A pointer to the previous state.
void Update ( void   )  const [inline]

This function will trigger update on the global state the current state.

void ChangeState ( IState State  )  const [inline]

Change to a new current state.

Parameters:
State A state that will be the current state or also the null state instance (ce::NullState) or also the NULL value.

Here is the caller graph for this function:

void RevertToPreviousState ( void   )  const [inline]

Change back the current state to the previous state.

Here is the call graph for this function:

short IsInState ( const IState State  )  const [inline]

Check if state is equal to the current state in use of the FSM.

Parameters:
State A state that will be the current state or also the null state instance (ce::NullState).
Returns:
TRUE if the current state's type is equal to the type of the class passed as a parameter.
const IStateManager* operator-> ( void   )  const [inline]

Member Data Documentation

IState* GlobalState [mutable, protected]

This state logic is called every time the FSM is updated.

IState* CurrentState [mutable, protected]

A pointer to an instance of a current state.

IState* PreviousState [mutable, protected]

A record of the last current state the agent was in.


The documentation for this class was generated from the following file:
Copyleft (cc) 2010 by FX Programmer. Some Rights Reserved.