14 BotStateBase m_ParentState;
17 void BotStateBase (Bot bot = NULL, BotStateBase parent = NULL) { m_Bot = bot; m_Owner = bot.m_Owner; m_ParentState = parent; }
19 PlayerBase GetPlayerOwner() {
return m_Owner; }
24 void SetParentState (BotStateBase parent) { m_ParentState = parent; }
28 BotStateBase GetParentState () {
return m_ParentState; }
30 bool HasFSM () {
return m_FSM != NULL; }
31 BotFSM GetFSM () {
return m_FSM; }
33 bool ProcessEvent (BotEventBase e)
36 return m_FSM.ProcessEvent(e);
43 void AddTransition (FSMTransition<BotStateBase, BotEventBase, BotActionBase, BotGuardBase> t)
46 m_FSM.AddTransition(t);
48 Error(
"[botfsm] adding transition to state without FSM. Configure FSM first.");
59 if (HasFSM() && !m_FSM.IsRunning())
75 if (HasFSM() && m_FSM.IsRunning())
76 m_FSM.GetCurrentState().OnUpdate(dt);
85 if (HasFSM() && m_FSM.IsRunning())
97 void OnExit (BotEventBase e)
106 bool IsWaitingForActionFinish () {
return HasFSM() && m_FSM.IsRunning() && m_FSM.GetCurrentState().IsWaitingForActionFinish(); }
112 bool IsIdle () {
return false; }
119 void OnSubMachineChanged (BotStateBase src, BotStateBase dst) { }
126 void OnStateChanged (BotStateBase src, BotStateBase dst) { }
129class BotStateIdle : BotStateBase
131 void BotStateIdle (
Bot bot = NULL, BotStateBase parent = NULL) { m_Bot = bot; m_Owner = m_Bot.m_Owner; m_ParentState = parent; }
133 override bool IsIdle () {
return true; }
void botDebugPrint(string s)
represent weapon state base
void Error(string err)
Messagebox with error message.
HandStateEquipped OnEntry
class WeaponChambering extends WeaponStateBase IsWaitingForActionFinish
class WeaponChambering_Chamber_OnEntry extends WeaponChambering_Base OnExit