AiMalgam Core 1.1.0
API documentation for the generic Unity3D AI System
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma Class Reference

A helper class that stores a Label which generates its respective LabelHash to compare other lemmas and their hierarchies. Is visible and assignable in the Unity inspector More...

Public Member Functions

virtual bool AddChild (AiMalgamBaseLemma child)
 Adds a Lemma as a child in Children distinct. Also updates the IsLeaf property More...
 
virtual bool RemoveChild (AiMalgamBaseLemma child, bool clearParentOfChild=true)
 Removes the child from Children and optionally clears its AiMalgamBaseLemma.parent. Also updates the IsLeaf property More...
 
virtual void ClearChildren (bool clearParentOfChildren=true)
 Clears the Children and resets their parents, if clearParentOfChildren == true More...
 
virtual bool IsAncestorOrSelf (AiMalgamBaseLemma ancestor)
 Checks if ancestor is this Lemma or matches an ancestor (some parent along the hierarchy) More...
 
virtual bool InLemma< BaseLemma > (BaseLemma matchingLemma, bool traverseAncestorsOfThis=true)
 Checks if the given matchingLemma matches this (or this hierarchy, if traverseAncestorsOfThis == true) More...
 
- Public Member Functions inherited from NikosAssets.AiMalgam.Settings.AiMalgamNode
override void OnOpen ()
 Called if the AiMalgamNodeGraph hosting this Node is opened
 
virtual void NotifyOnNodeChanged ()
 A helper method to notify node value changes and emit the OnNodeChanged event
 
override object GetValue (NodePort port)
 Used in the AiMalgamNodeGraph. More...
 
virtual void ResetMarkingInGraph (AiMalgamEntity requester, bool forceRepaint=false)
 EDITOR ONLY EFFECT. Reset the node's visuals in the AiMalgamNodeGraph More...
 
virtual void MarkInGraph (AiMalgamEntity requester, bool acceptedOrFailed, bool forceRepaint=false)
 EDITOR ONLY EFFECT. Set the node's visuals in the AiMalgamNodeGraph (accepted or failed) More...
 
virtual void MarkInGraph (AiMalgamEntity requester, Color markColor, bool forceRepaint=false)
 EDITOR ONLY EFFECT. Set the node's visuals in the AiMalgamNodeGraph More...
 

Static Public Member Functions

static bool OneLemmaMatchesAny< BaseLemma > (BaseLemma mainLemma, List< BaseLemma > matchingLemmas, bool traverseAncestorsOfMainLemma=true)
 Checks if the given matchingLemmas match the mainLemma (or its hierarchy, if traverseAncestorsOfMainLemma == true). Any/ At least one More...
 
static bool AnyLemmaMatch< BaseLemma > (List< BaseLemma > mainLemmas, List< BaseLemma > matchingLemmas, bool traverseAncestorsOfMainLemmas=true)
 Checks if the given matchingLemmas match the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). Any/ At least one More...
 
static bool AnyLemmaMatchesOne< BaseLemma > (List< BaseLemma > mainLemmas, BaseLemma matchingLemma, bool traverseAncestorsOfMainLemmas=true)
 Checks if the given matchingLemma matches the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). Any/ At least one More...
 
static bool AllLemmasMatch< BaseLemma > (List< BaseLemma > mainLemmas, List< BaseLemma > matchingLemmas, bool traverseAncestorsOfMainLemmas=true)
 Checks if the given matchingLemmas match the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). All must match! More...
 
static bool AllLemmasMatchOne< BaseLemma > (List< BaseLemma > mainLemmas, BaseLemma matchingLemma, bool traverseAncestorsOfMainLemmas=true)
 Checks if the given matchingLemma matches the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). All must match! More...
 

Public Attributes

AiMalgamBaseLemma parent
 Build a hierarchy or group of Lemma(s) to categorize them and enable more advanced Lemma comparisons
 

Protected Member Functions

override void Reset ()
 
override void OnEnable ()
 
override void OnValidate ()
 
- Protected Member Functions inherited from NikosAssets.AiMalgam.Settings.AiMalgamNode
override void Reset ()
 
override void OnEnable ()
 
override void Awake ()
 
override void OnValidate ()
 

Protected Attributes

string _label = "Default Label 1243"
 The label to generate the LabelHash and use for lemma comparisons
 
ulong _labelHash = 0
 The hashed label (string to INT64) for faster comparisons
 
AiMalgamBaseLemma _oldParent
 Used to update the _children if the hierarchy changed
 
bool _isLeaf = true
 Does this Lemma have any children (false) otherwise (true)?
 
bool _isRoot = true
 Does this Lemma have a parent (false) otherwise (true)?
 
List< AiMalgamBaseLemma_children = new List<AiMalgamBaseLemma>()
 The child Lemmas of this Lemma to represent a Lemma hierarchy
 

Properties

virtual string Label [get, set]
 The label to generate the LabelHash and use for lemma comparisons. Setting this property will generate the LabelHash automatically
 
virtual ulong LabelHash [get]
 The hashed label (string to INT64) for faster comparisons
 
bool IsLeaf [get]
 Does this Lemma have any children (false) otherwise (true)?
 
bool IsRoot [get]
 Does this Lemma have a parent (false) otherwise (true)?
 
List< AiMalgamBaseLemmaChildren [get]
 The child Lemmas of this Lemma to represent a Lemma hierarchy
 

Additional Inherited Members

- Events inherited from NikosAssets.AiMalgam.Settings.AiMalgamNode
virtual Action< AiMalgamNodeOnNodeChanged
 Emitted, if the node values where changed (OnValidate())
 

Detailed Description

A helper class that stores a Label which generates its respective LabelHash to compare other lemmas and their hierarchies. Is visible and assignable in the Unity inspector

Member Function Documentation

◆ AddChild()

virtual bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.AddChild ( AiMalgamBaseLemma  child)
virtual

Adds a Lemma as a child in Children distinct. Also updates the IsLeaf property

Parameters
childThe child to add to Children
Returns
true on success, false on fail (duplicate, recursive or null child)

◆ AllLemmasMatch< BaseLemma >()

static bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.AllLemmasMatch< BaseLemma > ( List< BaseLemma >  mainLemmas,
List< BaseLemma >  matchingLemmas,
bool  traverseAncestorsOfMainLemmas = true 
)
static

Checks if the given matchingLemmas match the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). All must match!

Parameters
mainLemmasThe main Lemmas to be matched against
matchingLemmasThe Lemmas to match
traverseAncestorsOfMainLemmasShould we only check mainLemmas ' instances (false) or their hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
All lemmas match directly or their hierarchy = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ AllLemmasMatchOne< BaseLemma >()

static bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.AllLemmasMatchOne< BaseLemma > ( List< BaseLemma >  mainLemmas,
BaseLemma  matchingLemma,
bool  traverseAncestorsOfMainLemmas = true 
)
static

Checks if the given matchingLemma matches the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). All must match!

Parameters
mainLemmasThe main Lemmas to be matched against
matchingLemmaThe Lemma to match
traverseAncestorsOfMainLemmasShould we only check mainLemmas ' instances (false) or their hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
All lemmas match directly or their hierarchy = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ AnyLemmaMatch< BaseLemma >()

static bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.AnyLemmaMatch< BaseLemma > ( List< BaseLemma >  mainLemmas,
List< BaseLemma >  matchingLemmas,
bool  traverseAncestorsOfMainLemmas = true 
)
static

Checks if the given matchingLemmas match the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). Any/ At least one

Parameters
mainLemmasThe main Lemmas to be matched against
matchingLemmasThe Lemmas to match
traverseAncestorsOfMainLemmasShould we only check mainLemmas ' instances (false) or their hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
Any lemmas match directly or their hierarchy = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ AnyLemmaMatchesOne< BaseLemma >()

static bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.AnyLemmaMatchesOne< BaseLemma > ( List< BaseLemma >  mainLemmas,
BaseLemma  matchingLemma,
bool  traverseAncestorsOfMainLemmas = true 
)
static

Checks if the given matchingLemma matches the mainLemmas (or their hierarchy, if traverseAncestorsOfMainLemmas == true). Any/ At least one

Parameters
mainLemmasThe main Lemmas to be matched against
matchingLemmaThe Lemma to match
traverseAncestorsOfMainLemmasShould we only check mainLemmas ' instances (false) or their hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
Any lemmas match directly or their hierarchy = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ ClearChildren()

virtual void NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.ClearChildren ( bool  clearParentOfChildren = true)
virtual

Clears the Children and resets their parents, if clearParentOfChildren == true

Parameters
clearParentOfChildren

◆ InLemma< BaseLemma >()

virtual bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.InLemma< BaseLemma > ( BaseLemma  matchingLemma,
bool  traverseAncestorsOfThis = true 
)
virtual

Checks if the given matchingLemma matches this (or this hierarchy, if traverseAncestorsOfThis == true)

Parameters
matchingLemmaThe Lemma to match
traverseAncestorsOfThisShould we only check this instance (false) or this hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
Any lemma matches this (or hierarchy) = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ IsAncestorOrSelf()

virtual bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.IsAncestorOrSelf ( AiMalgamBaseLemma  ancestor)
virtual

Checks if ancestor is this Lemma or matches an ancestor (some parent along the hierarchy)

Parameters
ancestorThe potential (matching) ancestor Lemma of this hierarchy
Returns
true if match found, otherwise false

◆ OneLemmaMatchesAny< BaseLemma >()

static bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.OneLemmaMatchesAny< BaseLemma > ( BaseLemma  mainLemma,
List< BaseLemma >  matchingLemmas,
bool  traverseAncestorsOfMainLemma = true 
)
static

Checks if the given matchingLemmas match the mainLemma (or its hierarchy, if traverseAncestorsOfMainLemma == true). Any/ At least one

Parameters
mainLemmaThe main Lemma to be matched against
matchingLemmasThe Lemma to match
traverseAncestorsOfMainLemmaShould we only check mainLemma s instance (false) or its hierarchy as well (true) ?
Template Parameters
BaseLemmaThe Lemma type, that must inherit from AiMalgamBaseLemma
Returns
Any lemmas match directly or their hierarchy = true, otherwise false
Type Constraints
BaseLemma :AiMalgamBaseLemma 

◆ RemoveChild()

virtual bool NikosAssets.AiMalgam.Settings.AiMalgamBaseLemma.RemoveChild ( AiMalgamBaseLemma  child,
bool  clearParentOfChild = true 
)
virtual

Removes the child from Children and optionally clears its AiMalgamBaseLemma.parent. Also updates the IsLeaf property

Parameters
childThe Lemma to remove from Children
clearParentOfChildShould the AiMalgamBaseLemma.parent be reset of the child on removal success ?
Returns
the success of the removal