AiMalgam Core 1.1.0
API documentation for the generic Unity3D AI System
|
The core and mandatory MonoBehaviour to represent an AI entity with its linked AI systems More...
Public Member Functions | |
virtual void | AddDescriptor (AiMalgamBaseDescriptor descriptor) |
Add another AiMalgamBaseDescriptor to Descriptors (distinct instance) and emit the OnDescriptorListChanged event on success More... | |
virtual bool | RemoveDescriptor (AiMalgamBaseDescriptor descriptor) |
Remove an existing AiMalgamBaseDescriptor to Descriptors and emit the OnDescriptorListChanged event on removal success More... | |
virtual void | AddEngine (AiMalgamBaseEngineWrapper baseEngineWrapper) |
Add another AiMalgamBaseEngineWrapper to Engines (distinct instance) and emit the OnEnginesListChanged event on success More... | |
virtual bool | RemoveEngine (AiMalgamBaseEngineWrapper baseEngineWrapper) |
Remove an existing AiMalgamBaseEngineWrapper to Engines and emit the OnEnginesListChanged event on removal success More... | |
virtual void | CleanInvalidEngines () |
Helper method to remove old (and wrong) AiMalgamBaseEngineWrappers from Engines | |
virtual void | CleanInvalidDescriptors () |
Helper method to remove old (and wrong) AiMalgamBaseDescriptors from Descriptors | |
virtual void | RemoveAllActionsAcrossAllEngines () |
virtual bool | AddStateDistinct (AiMalgamState state, AiMalgamBaseEngineWrapper baseEngineWrapper=null) |
Adds the state to currentStates (distinct) and emits the OnStateChangedUnityEvent and OnStateChanged events on success More... | |
virtual bool | RemoveState (AiMalgamState state, AiMalgamBaseEngineWrapper baseEngineWrapper=null) |
Remove the state from currentStates and emit the OnStateChangedUnityEvent and OnStateChanged events on success More... | |
virtual List< BaseDescriptor > | GetDescriptorsByHash< BaseDescriptor > (int hash) |
Get the AiMalgamBaseDescriptors that match their AiMalgamBaseDescriptor.DescriptorTypeSupportedHash with the given hash More... | |
virtual AiMalgamBaseEngineWrapper | GetEngineByHash (int hash) |
Get the AiMalgamBaseEngineWrapper that matches its AiMalgamBaseEngineWrapper.ActionTypeSupportedHash with the given hash More... | |
virtual List< AiMalgamBaseEngineWrapper > | GetEnginesByHash (int hash) |
Get the AiMalgamBaseEngineWrappers that match their AiMalgamBaseEngineWrapper.ActionTypeSupportedHash with the given hash More... | |
virtual AiMalgamApplyActionSettingResult | ValidateSettings (AiMalgamBaseSettings baseSettings, out AiMalgamBaseEngineWrapper outEngine) |
Validate the given baseSettings by checking if their supported AiMalgamBaseEngineWrapper exists in Engines and if AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ValidateSettings also validates More... | |
virtual AiMalgamApplyActionSettingResult | ApplyAndValidateSettings (AiMalgamBaseSettings baseSettings, bool ignoreValidation=false) |
Optionally (ignoreValidation == false) validate the given baseSettings by checking if their supported AiMalgamBaseEngineWrapper exists in Engines and if AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ValidateSettings also validates and finally apply the settings in AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ApplySettings More... | |
Public Attributes | |
OnStateChangedUnityEvent | OnStateChangedUnityEvent |
List< AiMalgamState > | currentStates = new List<AiMalgamState>() |
Represents IAiMalgamBaseActionWrappers or independent AiMalgamStates associated with this entity | |
Protected Member Functions | |
virtual void | Awake () |
virtual void | Start () |
virtual void | OnEnable () |
virtual void | OnDisable () |
virtual void | OnDestroy () |
virtual void | OnValidate () |
virtual void | InvokeStateChanged (AiMalgamBaseEngineWrapper engine, AiMalgamState state, bool addedOrRemoved) |
Protected Attributes | |
List< AiMalgamBaseDescriptor > | _descriptors = new List<AiMalgamBaseDescriptor>() |
Additional data containers also used in AiMalgamBaseConditionForDescriptors<DescriptorType> for AI decision making | |
List< AiMalgamBaseEngineWrapper > | _engines = new List<AiMalgamBaseEngineWrapper>() |
AiMalgamBaseEngineWrappers attached to this entity, which run their respective and supported IAiMalgamBaseActionWrappers on | |
Properties | |
List< AiMalgamBaseDescriptor > | Descriptors [get] |
Additional data containers also used in AiMalgamBaseConditionForDescriptors<DescriptorType> for AI decision making | |
List< AiMalgamBaseEngineWrapper > | Engines [get] |
AiMalgamBaseEngineWrappers attached to this entity, which run their respective and supported IAiMalgamBaseActionWrappers on | |
Events | |
Action< AiMalgamBaseEngineWrapper, bool > | OnEnginesListChanged |
Action< AiMalgamBaseDescriptor, bool > | OnDescriptorListChanged |
Action< AiMalgamBaseEngineWrapper, AiMalgamState, bool > | OnStateChanged |
The core and mandatory MonoBehaviour to represent an AI entity with its linked AI systems
|
virtual |
Add another AiMalgamBaseDescriptor to Descriptors (distinct instance) and emit the OnDescriptorListChanged event on success
descriptor | The AiMalgamBaseDescriptor to add |
|
virtual |
|
virtual |
Adds the state to currentStates (distinct) and emits the OnStateChangedUnityEvent and OnStateChanged events on success
state | The AiMalgamState to add to currentStates |
baseEngineWrapper | The AiMalgamBaseEngineWrapper which caused this call |
|
virtual |
Optionally (ignoreValidation == false) validate the given baseSettings by checking if their supported AiMalgamBaseEngineWrapper exists in Engines and if AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ValidateSettings also validates and finally apply the settings in AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ApplySettings
baseSettings | The AiMalgamBaseSettings apply (and optionally validate) |
ignoreValidation | Do we validate the given AiMalgamBaseSettings or jump into applying them. The only thing that is left validating (if set to true), is to check if the matching AiMalgamBaseEngineWrapper exists |
|
virtual |
Get the AiMalgamBaseDescriptors that match their AiMalgamBaseDescriptor.DescriptorTypeSupportedHash with the given hash
hash | The hash to match against AiMalgamBaseDescriptor.AiMalgamBaseDescriptor.DescriptorTypeSupportedHash |
BaseDescriptor | The AiMalgamBaseDescriptor type to cast |
BaseDescriptor | : | AiMalgamBaseDescriptor |
|
virtual |
Get the AiMalgamBaseEngineWrapper that matches its AiMalgamBaseEngineWrapper.ActionTypeSupportedHash with the given hash
hash | The hash to match against AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ActionTypeSupportedHash |
|
virtual |
Get the AiMalgamBaseEngineWrappers that match their AiMalgamBaseEngineWrapper.ActionTypeSupportedHash with the given hash
hash | The hash to match against AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ActionTypeSupportedHash |
|
virtual |
Remove an existing AiMalgamBaseDescriptor to Descriptors and emit the OnDescriptorListChanged event on removal success
descriptor | The AiMalgamBaseDescriptor to remove from Descriptors |
|
virtual |
|
virtual |
Remove the state from currentStates and emit the OnStateChangedUnityEvent and OnStateChanged events on success
state | The AiMalgamState to remove from currentStates |
baseEngineWrapper | The AiMalgamBaseEngineWrapper which caused this call |
|
virtual |
Validate the given baseSettings by checking if their supported AiMalgamBaseEngineWrapper exists in Engines and if AiMalgamBaseEngineWrapper.AiMalgamBaseEngineWrapper.ValidateSettings also validates
baseSettings | The AiMalgamBaseSettings to validate |
outEngine | The found (or not found) AiMalgamBaseEngineWrapper for the given baseSettings |