AiMalgam Core 1.1.0
API documentation for the generic Unity3D AI System
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | Events | List of all members
NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem Class Reference

Handles AiMalgamDeciderWrappers to make an AiMalgamDecision for an AiMalgamEntity More...

Public Member Functions

virtual void Tick (IAiMalgamDecider rootAIDecider)
 If _makeDecision or alwaysMakeDecision == true, traverse through the rootAIDecider and emit the OnPrepareNextDecision, onDecisionMadeUnityEvent and OnDecisionMade events More...
 
virtual void MakeDecision (bool forceNow=false)
 Makes a AiMalgamDecision in the next Tick call, unless its forced to do so now (forceNow == true) More...
 
virtual void MakeDecision (bool forceNow, IAiMalgamDecider decider)
 Makes a AiMalgamDecision in the next Tick call, unless its forced to do so now (forceNow == true) More...
 
virtual void HandleSettingsSequentialAsync (List< AiMalgamAsyncActionQueueHandler > newAsyncSettingsStorageHandlers)
 Handles new and old AiMalgamAsyncActionQueueHandlers attached to this system More...
 

Public Attributes

OnDecisionMadeUnityEvent onDecisionMadeUnityEvent = new OnDecisionMadeUnityEvent()
 
bool alwaysMakeDecision
 Should the AiMalgamDecision be made on every Tick call or only if _makeDecision == true?
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void OnDestroy ()
 
virtual void Reset ()
 
virtual void OnValidate ()
 
virtual void AutoFill ()
 
virtual void CheckRequiredEngines ()
 Fill the _enginesRequiredByGraph array to indicate what AiMalgamBaseEngineWrappers are required to be on the hosting AiMalgamEntity
 
virtual void CheckRequiredDescriptors ()
 Fill the _descriptorsRequiredByGraph array to indicate what AiMalgamBaseDescriptors are required to be on the hosting AiMalgamEntity
 

Protected Attributes

List< AiMalgamAsyncActionQueueHandler_asyncSettingsStorageHandlers
 
bool _makeDecision = true
 Make an AiMalgamDecision on the next Tick call. Will be set to false, once the decision was made!
 
AiMalgamEntity _aiMalgamEntity
 The hosting AiMalgamEntity the AiMalgamDecision is meant for
 
AiMalgamNodeGraph _nodeGraph
 The AiMalgamNodeGraph to be traversed for an AiMalgamDecision
 
AiMalgamNodeGraph _prevNodeGraph
 Used if the developer changed the _nodeGraph field or NodeGraph property (at runtime)
 
string[] _enginesRequiredByGraph = new string[0]
 Contains the required AiMalgamBaseEngineWrappers for every found AiMalgamBaseSettings in the NodeGraph that are required to be on the AiMalgamEntity
 
string[] _descriptorsRequiredByGraph = new string[0]
 Contains the required AiMalgamBaseDescriptors for every found AiMalgamBaseConditionForDescriptors<DescriptorType> in the NodeGraph that are required to be on the AiMalgamEntity
 
AiMalgamDecision _currentDecision = new AiMalgamDecision()
 The current/ last AiMalgamDecision made by this system
 

Properties

AiMalgamEntity AiMalgamEntity [get, set]
 The hosting AiMalgamEntity the AiMalgamDecision is meant for
 
AiMalgamNodeGraph NodeGraph [get, set]
 The AiMalgamNodeGraph to be traversed for an AiMalgamDecision
 
AiMalgamDecision CurrentDecision [get]
 The current/ last AiMalgamDecision made by this system
 
int DecisionsMade = 0 [get, protected set]
 How many AiMalgamDecisions were made by this system? Displayed in the AiMalgamNodeGraph if this is selected in Unity by the developer
 

Events

Action< AiMalgamDecisionOnDecisionMade
 
Action OnPrepareNextDecision
 

Detailed Description

Handles AiMalgamDeciderWrappers to make an AiMalgamDecision for an AiMalgamEntity

Member Function Documentation

◆ HandleSettingsSequentialAsync()

virtual void NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem.HandleSettingsSequentialAsync ( List< AiMalgamAsyncActionQueueHandler newAsyncSettingsStorageHandlers)
virtual

Handles new and old AiMalgamAsyncActionQueueHandlers attached to this system

Parameters
newAsyncSettingsStorageHandlersThe upcoming desired AiMalgamAsyncActionQueueHandlers

◆ MakeDecision() [1/2]

virtual void NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem.MakeDecision ( bool  forceNow,
IAiMalgamDecider  decider 
)
virtual

Makes a AiMalgamDecision in the next Tick call, unless its forced to do so now (forceNow == true)

Parameters
forceNowmake the AiMalgamDecision now or in the next Tick. To safe performance, it is recommended to keep this set to false (unless immediate action is required of course)
deciderThe IAiMalgamDecider to traverse

◆ MakeDecision() [2/2]

virtual void NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem.MakeDecision ( bool  forceNow = false)
virtual

Makes a AiMalgamDecision in the next Tick call, unless its forced to do so now (forceNow == true)

Parameters
forceNowmake the AiMalgamDecision now or in the next Tick. To safe performance, it is recommended to keep this set to false (unless immediate action is required of course)

◆ Tick()

virtual void NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem.Tick ( IAiMalgamDecider  rootAIDecider)
virtual

If _makeDecision or alwaysMakeDecision == true, traverse through the rootAIDecider and emit the OnPrepareNextDecision, onDecisionMadeUnityEvent and OnDecisionMade events

Parameters
rootAIDeciderThe AiMalgamDeciderWrapper to traverse and form the AiMalgamDecision

Member Data Documentation

◆ _asyncSettingsStorageHandlers

List<AiMalgamAsyncActionQueueHandler> NikosAssets.AiMalgam.Systems.Decisions.AiMalgamBaseDecisionSystem._asyncSettingsStorageHandlers
protected
Initial value:
=
new List<AiMalgamAsyncActionQueueHandler>()