Skip to main content
Version: Next

Behaviour

Description

Used to manage the different behaviour applicators for a given agent.

Interface

Type
IBehaviourService

Inherits

Type
N/A

Properties

NameType
controllerDictionary<BehaviourType, IBehaviourApplicator>
queueAIControllerQueue
currentControllerBehaviourType
previousControllerBehaviourType

Public Methods

NameParametersReturn TypeDescription
BehaviourServiceAIControllerQueue aIControllerQueueBehaviourServiceA constructor for BehaviourService.
AddControllerIBehaviourApplicator candidatevoidUsed to add a IBehaviourApplicator to the service.
GetActiveControllerN/AIBehaviourApplicatorReturns the current IBehaviourApplicator in use.
GetControllerBehaviourType behaviourTypeIBehaviourApplicatorReturns the controller for the behaviourType if present else null.
UpsertCandidateControllerCandidate candidatevoidAdds or replaces ControllerCandidate to the queue.
RemoveCandidateBehaviourType behaviourTypevoidRemoves the ControllerCandidate in the queue for the behaviourType if present.
GetControllerQueueN/AAIControllerQueueReturns the queue.
UpdateWeightingIAgentService agent, float time, BehaviourType behaviourType = BehaviourType.NullbooleanTriggers an update of weighting for each IBehaviourApplicator in queue.
UpdateIAgentService agent, float timevoidEvaluate the current queue and apply highest weighted behaviour to agent.