Crystal AI  1.0.0
Crystal.ISelector Interface Reference

Interface for Selectors. Selectors are functions that accept a vector of T:Crystal.Utilitys and return an index that corresponds to the selected T:Crystal.Utility. More...

Inheritance diagram for Crystal.ISelector:
Crystal.IAiPrototype< ISelector > Crystal.MaxUtilitySelector Crystal.RandomSelector Crystal.SequentialSelector Crystal.WeightedRandomSelector

Public Member Functions

int Select (ICollection< Utility > elements)
 Selects a T:Crystal.Utility from the given set and returns its index. More...
 
- Public Member Functions inherited from Crystal.IAiPrototype< ISelector >
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...
 

Detailed Description

Interface for Selectors. Selectors are functions that accept a vector of T:Crystal.Utilitys and return an index that corresponds to the selected T:Crystal.Utility.

See also
T:Crystal.IAiPrototype`1

Member Function Documentation

int Crystal.ISelector.Select ( ICollection< Utility elements)

Selects a T:Crystal.Utility from the given set and returns its index.

Parameters
elementsThe elements.
Returns
The index of the selected utility. This returns -1 no selection was made or if the count of elements was 0.

Implemented in Crystal.WeightedRandomSelector, Crystal.SequentialSelector, Crystal.MaxUtilitySelector, and Crystal.RandomSelector.


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