Class RandomRangeValue
Value provider that returns a random integer between Min and Max (inclusive). Uses the deterministic DeterministicRNG from RNG when available, otherwise falls back to Shared.
[Serializable]
public sealed class RandomRangeValue : IIntValueProvider
- Inheritance
-
RandomRangeValue
- Implements
- Inherited Members
Fields
Max
The maximum value (inclusive).
[Tooltip("The maximum value (inclusive).")]
public int Max
Field Value
Min
The minimum value (inclusive).
[Tooltip("The minimum value (inclusive).")]
public int Min
Field Value
Methods
Describe()
Describes the value in words, without a character or an event to compute it against.
public string Describe()
Returns
- string
The description, or null when the value is only knowable at execution time.
Remarks
A tooltip is written long before anything is cast, so it cannot call GetValue(ICharacter, EventData) — there is no initiator, no target and no RNG stream. A provider that knows its own numbers can still say what they are ("18 - 24"), and one that cannot returns null so the caller writes nothing rather than a placeholder.
On the interface rather than in a switch statement somewhere in the UI, because a new provider should have to answer this to compile.
GetValue(ICharacter, EventData)
Computes and returns the integer value for the current execution context.
public int GetValue(ICharacter initiator, EventData eventData)
Parameters
initiatorICharacterThe character initiating the action (used for stat lookups, etc.).
eventDataEventDataThe event data for the current execution (used for RNG, target info, etc.).
Returns
- int
The computed integer value.