Struct Weighted<T>
A wrapper to hold an item along with its associated weight value.
Assembly: Glitch9.AIDevKit.dll
Syntax
public readonly struct Weighted<T> : IPrompt, IValidatable
Type Parameters
Constructors
|
Edit this page
View Source
Weighted(T, float)
Declaration
public Weighted(T value, float weight = 1)
Parameters
| Type |
Name |
Description |
| T |
value |
|
| float |
weight |
|
Properties
|
Edit this page
View Source
Value
Declaration
Property Value
|
Edit this page
View Source
Weight
Declaration
public float Weight { get; }
Property Value
Methods
|
Edit this page
View Source
GetPromptText()
Declaration
public string GetPromptText()
Returns
|
Edit this page
View Source
IsValid()
Declaration
Returns
|
Edit this page
View Source
Validate()
Validates the object's parameters and throws if invalid.
Declaration
Operators
|
Edit this page
View Source
implicit operator T(Weighted<T>)
Declaration
public static implicit operator T(Weighted<T> weighted)
Parameters
| Type |
Name |
Description |
| Weighted<T> |
weighted |
|
Returns
|
Edit this page
View Source
implicit operator Weighted<T>(T)
Declaration
public static implicit operator Weighted<T>(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Implements
Extension Methods