Crystal AI  1.0.0
Crystal.UtilityAi Class Reference

The Utility AI. More...

Inheritance diagram for Crystal.UtilityAi:
Crystal.IUtilityAi Crystal.IAiPrototype< IUtilityAi >

Classes

class  AiAlreadyExistsInCollectionException
 
class  AiCollectionNullException
 
class  NameIdIsNullOrEmptyException
 

Public Member Functions

bool AddBehaviour (string behaviourId)
 Adds the behaviour associated with behaviourId to the AI. More...
 
bool RemoveBehaviour (string behaviourId)
 Removes the behaviour associated with behaviourId from the AI. More...
 
IAction Select (IContext context)
 Enters a selection process that selects one of the contained behaviours. This in turn selects one option within the selected behaviour and returns the action associated with that option. More...
 
IUtilityAi Clone ()
 Clones this instance. More...
 
 UtilityAi ()
 Initializes a new instance of the UtilityAi class. More...
 
 UtilityAi (string nameId, IAiCollection collection)
 Initializes a new instance of the UtilityAi class. More...
 
- Public Member Functions inherited from Crystal.IAiPrototype< IUtilityAi >
Clone ()
 Creates a new instance of the implementing class. Note that the semantics here are somewhat vague, however, by convention the "Prototype Pattern" uses a "Clone" function. Note that this may have very different semantics when compared with either shallow or deep cloning. When implementing this remember to include only the defining characteristics of the class and not its state! More...
 

Properties

string NameId [get, set]
 A unique name identifier for this AI. More...
 
ISelector Selector [get, set]
 Gets or sets the selector. More...
 
- Properties inherited from Crystal.IUtilityAi
string NameId [get]
 A unique name identifier for this AI. More...
 
ISelector Selector [get, set]
 Returns the selector associated with this AI. Also see T:Crystal.ISelector. More...
 

Detailed Description

The Utility AI.

See also
T:Crystal.IUtilityAi

Constructor & Destructor Documentation

Crystal.UtilityAi.UtilityAi ( )
inline

Initializes a new instance of the UtilityAi class.

Crystal.UtilityAi.UtilityAi ( string  nameId,
IAiCollection  collection 
)
inline

Initializes a new instance of the UtilityAi class.

Parameters
nameIdThe name identifier.
collectionThe collection.
Exceptions
Crystal.UtilityAi.NameIdIsNullOrEmptyException
Crystal.UtilityAi.AiCollectionNullException
Crystal.UtilityAi.AiAlreadyExistsInCollectionException

Member Function Documentation

bool Crystal.UtilityAi.AddBehaviour ( string  behaviourId)
inline

Adds the behaviour associated with behaviourId to the AI.

Parameters
behaviourIdThe behaviour identifier.
Returns
Returns true if the requested behaviour was added to the AI, false otherwise.

Implements Crystal.IUtilityAi.

IUtilityAi Crystal.UtilityAi.Clone ( )
inline

Clones this instance.

Returns
bool Crystal.UtilityAi.RemoveBehaviour ( string  behaviourId)
inline

Removes the behaviour associated with behaviourId from the AI.

Parameters
behaviourIdThe behaviour identifier.
Returns
Returns true if the behaviour was removed from the AI, false otherwise.

Implements Crystal.IUtilityAi.

IAction Crystal.UtilityAi.Select ( IContext  context)
inline

Enters a selection process that selects one of the contained behaviours. This in turn selects one option within the selected behaviour and returns the action associated with that option.

Parameters
contextThe context.
Returns
The action associated with the selected option.

Implements Crystal.IUtilityAi.

Property Documentation

string Crystal.UtilityAi.NameId
getset

A unique name identifier for this AI.

ISelector Crystal.UtilityAi.Selector
getset

Gets or sets the selector.

The selector.


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