This selector returns a random T:Crystal.Utility from the supplied T:System.Collections.ICollection.
More...
|
int | Select (ICollection< Utility > elements) |
| Selects a T:Crystal.Utility from the given set and returns its index. More...
|
|
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...
|
|
| RandomSelector () |
| Initializes a new instance of the T:Crystal.RandomSelector class. More...
|
|
| RandomSelector (Pcg random) |
| Initializes a new instance of the T:Crystal.RandomSelector class. More...
|
|
T | 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...
|
|
This selector returns a random T:Crystal.Utility from the supplied T:System.Collections.ICollection.
- See also
- T:Crystal.ISelector
Crystal.RandomSelector.RandomSelector |
( |
| ) |
|
|
inline |
Initializes a new instance of the T:Crystal.RandomSelector class.
Crystal.RandomSelector.RandomSelector |
( |
Pcg |
random | ) |
|
|
inline |
Initializes a new instance of the T:Crystal.RandomSelector class.
- Parameters
-
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!
- Returns
int Crystal.RandomSelector.Select |
( |
ICollection< Utility > |
elements | ) |
|
|
inline |
Selects a T:Crystal.Utility from the given set and returns its index.
- Parameters
-
- Returns
- The index of the selected utility. This returns -1 no selection was made or if the count of elements was 0.
Implements Crystal.ISelector.
The documentation for this class was generated from the following file:
- Source/Selectors/RandomSelector.cs