PC Stable Documentation
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Loading...
Searching...
No Matches
BotStateBase Class Reference

represent weapon state base More...

Private Member Functions

void BotHunt (Bot bot=NULL, BotStateBase parent=NULL)
 
void SelectTarget ()
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void BotStanceRandomizer (Bot bot=NULL, BotStateBase parent=NULL)
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void BotTestAttachAndDropCycle (Bot bot=NULL, BotStateBase parent=NULL)
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void BotTestItemMoveBackAndForth (Bot bot=NULL, BotStateBase parent=NULL)
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
int GetNextSlot (int curr)
 
override void OnUpdate (float dt)
 
void BotSpawnEntityInHands (Bot bot=NULL, BotStateBase parent=NULL, string new_type="")
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void Bot_TestSpawnOpen (Bot bot=NULL, BotStateBase parent=NULL, string new_type="")
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
override void OnEntry (BotEventBase e)
 
override void OnAbort (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void BotTimedWait (Bot bot=NULL, BotStateBase parent=NULL, float timeout=3.0)
 
override void OnEntry (BotEventBase e)
 
override void OnExit (BotEventBase e)
 
override void OnUpdate (float dt)
 
void OnTimeout ()
 
void BotStateBase (Bot bot=NULL, BotStateBase parent=NULL)
 nested state machine (or null)
 
PlayerBase GetPlayerOwner ()
 
void SetParentState (BotStateBase parent)
 allows construction of hierarchical state machine
 
BotStateBase GetParentState ()
 
bool HasFSM ()
 
BotFSM GetFSM ()
 
bool ProcessEvent (BotEventBase e)
 
void AddTransition (FSMTransition< BotStateBase, BotEventBase, BotActionBase, BotGuardBase > t)
 adds transition into m_FSM transition table
 
void OnEntry (BotEventBase e)
 
void OnUpdate (float dt)
 
void OnAbort (BotEventBase e)
 
void OnExit (BotEventBase e)
 
bool IsWaitingForActionFinish ()
 waiting for active animation action/actionType finish
 
bool IsIdle ()
 idle state does not expect any animation events
 
void OnSubMachineChanged (BotStateBase src, BotStateBase dst)
 called when sub-machine has changed its state
 
void OnStateChanged (BotStateBase src, BotStateBase dst)
 called on current state when state machine has changed its state
 

Private Attributes

Man m_Target
 
float m_dtAccumulator = 0.0
 
ref BotHunt_Tracking m_Tracking
 
ref BotHunt_Hunting m_Hunting
 
EntityAI m_Target
 
bool m_TargetInSight = false
 
bool m_TargetLost = false
 
bool m_Tracking = true
 
ref HumanMovementState m_State = new HumanMovementState()
 
EntityAI m_Entity
 
ref BotTestAttachAndDropCycle_Detaching m_Detaching
 
ref BotTestAttachAndDropCycle_Attaching m_Attaching
 
ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move
 
int m_WaitingForSlot = InventorySlots.INVALID
 
int m_hgSlot = InventorySlots.GetSlotIdFromString("Headgear")
 
int m_mskSlot = InventorySlots.GetSlotIdFromString("Mask")
 
string m_Type
 
ref BotSpawnEntityInHands m_Spawning
 
ref BotOpenEntityInHands m_Opening
 
protected float m_dtAccumulator = 0.0
 
protected float m_Timeout = 3.0
 
protected bool m_Periodic = true
 
PlayerBase m_Owner
 
Bot m_Bot
 man that this state belongs to
 
BotStateBase m_ParentState
 bot that this state belongs to
 
ref BotFSM m_FSM
 hierarchical parent state of this state (or null)
 

Detailed Description

represent weapon state base

Class comes with entry/update/exit hooks that can be overriden in custom states

Class is ready for hierarchic composition, i.e. this state having a sub-machine running under hood. If no m_FSM member is configured, class acts as ordinary plain finite machine state.

Constructor & Destructor Documentation

◆ BotStateBase()

void BotStateBase ( Bot  bot = NULL,
BotStateBase  parent = NULL 
)
inlineprivate

nested state machine (or null)

References m_Bot, m_Owner, and m_ParentState.

Member Function Documentation

◆ AddTransition()

AddTransition ( FSMTransition< BotStateBase, BotEventBase, BotActionBase, BotGuardBase t)
inlineprivate

adds transition into m_FSM transition table

References Error(), HasFSM(), and m_FSM.

◆ Bot_TestSpawnOpen()

void Bot_TestSpawnOpen ( Bot  bot = NULL,
BotStateBase  parent = NULL,
string  new_type = "" 
)
inlineprivate

References m_Type.

◆ BotHunt()

void BotHunt ( Bot  bot = NULL,
BotStateBase  parent = NULL 
)
inlineprivate

◆ BotSpawnEntityInHands()

void BotSpawnEntityInHands ( Bot  bot = NULL,
BotStateBase  parent = NULL,
string  new_type = "" 
)
inlineprivate

References Empty, and m_Type.

◆ BotStanceRandomizer()

void BotStanceRandomizer ( Bot  bot = NULL,
BotStateBase  parent = NULL 
)
inlineprivate

◆ BotTestAttachAndDropCycle()

void BotTestAttachAndDropCycle ( Bot  bot = NULL,
BotStateBase  parent = NULL 
)
inlineprivate

◆ BotTestItemMoveBackAndForth()

void BotTestItemMoveBackAndForth ( Bot  bot = NULL,
BotStateBase  parent = NULL 
)
inlineprivate

◆ BotTimedWait()

void BotTimedWait ( Bot  bot = NULL,
BotStateBase  parent = NULL,
float  timeout = 3.0 
)
inlineprivate

◆ GetFSM()

BotFSM GetFSM ( )
inlineprivate

References m_FSM.

◆ GetNextSlot()

int GetNextSlot ( int  curr)
inlineprivate

References Error(), InventorySlots::INVALID, m_hgSlot, and m_mskSlot.

Referenced by OnUpdate().

◆ GetParentState()

GetParentState ( )
inlineprivate
Returns
state that owns this sub-state (or null if plain state)

References m_ParentState.

◆ GetPlayerOwner()

PlayerBase GetPlayerOwner ( )
inlineprivate

References m_Owner.

Referenced by OnUpdate(), and SelectTarget().

◆ HasFSM()

bool HasFSM ( )
inlineprivate

◆ IsIdle()

IsIdle ( )
inlineprivate

idle state does not expect any animation events

Returns
true if this state is idle

◆ IsWaitingForActionFinish()

IsWaitingForActionFinish ( )
inlineprivate

waiting for active animation action/actionType finish

Returns
true if this state or active substate is waiting for finish signal

References HasFSM(), and m_FSM.

◆ OnAbort() [1/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [2/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [3/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [4/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [5/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [6/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [7/8]

override void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnAbort() [8/8]

void OnAbort ( BotEventBase  e)
inlineprivate

◆ OnEntry() [1/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

References m_dtAccumulator, and SelectTarget().

◆ OnEntry() [2/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [3/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [4/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [5/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

References m_Entity, m_Entity, and m_Owner.

◆ OnEntry() [6/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [7/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [8/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [9/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [10/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

References m_Owner, and m_Type.

◆ OnEntry() [11/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [12/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [13/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [14/15]

override void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnEntry() [15/15]

void OnEntry ( BotEventBase  e)
inlineprivate

◆ OnExit() [1/15]

override void OnExit ( BotEventBase  e)
inlineprivate

References m_dtAccumulator, and m_Target.

◆ OnExit() [2/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [3/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [4/15]

override void OnExit ( BotEventBase  e)
inlineprivate

References m_dtAccumulator.

◆ OnExit() [5/15]

override void OnExit ( BotEventBase  e)
inlineprivate

References m_Entity.

◆ OnExit() [6/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [7/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [8/15]

override void OnExit ( BotEventBase  e)
inlineprivate

References m_Entity.

◆ OnExit() [9/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [10/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [11/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [12/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [13/15]

override void OnExit ( BotEventBase  e)
inlineprivate

◆ OnExit() [14/15]

override void OnExit ( BotEventBase  e)
inlineprivate

References m_dtAccumulator.

◆ OnExit() [15/15]

void OnExit ( BotEventBase  e)
inlineprivate

References botDebugPrint(), ToString(), and Type.

◆ OnStateChanged()

OnStateChanged ( BotStateBase  src,
BotStateBase  dst 
)
inlineprivate

called on current state when state machine has changed its state

Parameters
[in]srcfrom state (previous)
[in]dstto state (current)

◆ OnSubMachineChanged()

OnSubMachineChanged ( BotStateBase  src,
BotStateBase  dst 
)
inlineprivate

called when sub-machine has changed its state

Parameters
[in]srcfrom state (previous)
[in]dstto state (current)

◆ OnTimeout()

void OnTimeout ( )
inlineprivate

References botDebugSpam(), and m_Owner.

Referenced by OnUpdate().

◆ OnUpdate() [1/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [2/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [3/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [4/15]

◆ OnUpdate() [5/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [6/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [7/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [8/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [9/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [10/15]

override void OnUpdate ( float  dt)
inlineprivate

References botDebugPrint(), and m_Owner.

◆ OnUpdate() [11/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [12/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [13/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [14/15]

override void OnUpdate ( float  dt)
inlineprivate

◆ OnUpdate() [15/15]

void OnUpdate ( float  dt)
inlineprivate

References HasFSM(), and m_FSM.

◆ ProcessEvent()

bool ProcessEvent ( BotEventBase  e)
inlineprivate

References HasFSM(), and m_FSM.

◆ SelectTarget()

void SelectTarget ( )
inlineprivate

◆ SetParentState()

SetParentState ( BotStateBase  parent)
inlineprivate

allows construction of hierarchical state machine

References m_ParentState.

Field Documentation

◆ m_Attaching

ref BotTestAttachAndDropCycle_Attaching m_Attaching
private

◆ m_Bot

Bot m_Bot
private

◆ m_Detaching

ref BotTestAttachAndDropCycle_Detaching m_Detaching
private

◆ m_dtAccumulator [1/2]

float m_dtAccumulator = 0.0
private

Referenced by OnUpdate().

◆ m_dtAccumulator [2/2]

protected float m_dtAccumulator = 0.0
private

◆ m_Entity

EntityAI m_Entity
private

Referenced by OnEntry().

◆ m_FSM

ref BotFSM m_FSM
private

◆ m_hgSlot

int m_hgSlot = InventorySlots.GetSlotIdFromString("Headgear")
private

Referenced by GetNextSlot().

◆ m_Hunting

ref BotHunt_Hunting m_Hunting
private

◆ m_Move

ref BotTestItemMoveBackAndForth_MoveFromSlotToSlot m_Move
private

◆ m_mskSlot

int m_mskSlot = InventorySlots.GetSlotIdFromString("Mask")
private

Referenced by GetNextSlot().

◆ m_Opening

ref BotOpenEntityInHands m_Opening
private

◆ m_Owner

◆ m_ParentState

BotStateBase m_ParentState
private

bot that this state belongs to

Referenced by BotStateBase(), BotStateIdle::BotStateIdle(), GetParentState(), and SetParentState().

◆ m_Periodic

protected bool m_Periodic = true
private

◆ m_Spawning

ref BotSpawnEntityInHands m_Spawning
private

◆ m_State

ref HumanMovementState m_State = new HumanMovementState()
private

◆ m_Target [1/2]

EntityAI m_Target
private

Referenced by SelectTarget().

◆ m_Target [2/2]

EntityAI m_Target
private

◆ m_TargetInSight

bool m_TargetInSight = false
private

◆ m_TargetLost

bool m_TargetLost = false
private

◆ m_Timeout

protected float m_Timeout = 3.0
private

Referenced by OnUpdate().

◆ m_Tracking [1/2]

ref BotHunt_Tracking m_Tracking
private

◆ m_Tracking [2/2]

bool m_Tracking = true
private

◆ m_Type

string m_Type
private

◆ m_WaitingForSlot

int m_WaitingForSlot = InventorySlots.INVALID
private

The documentation for this class was generated from the following files: