Interface IDiceExpression
Interface for class representing a parsed dice expression. Returned by IParser implementations.
Namespace: GoRogue.DiceNotation
Assembly: GoRogue.dll
Syntax
public interface IDiceExpression
Methods
| Improve this Doc View SourceMaxRoll()
Returns the maximum possible result of the dice expression (the highest it could be).
Declaration
int MaxRoll()
Returns
Type | Description |
---|---|
System.Int32 | The maxiumum possible value that could be returned by this dice expression. |
Remarks
Typically this can be implemented by calling Roll(IGenerator) and passing in a MaxRandom instance.
MinRoll()
Returns the minimum possible result of the dice expression (the lowest it could be).
Declaration
int MinRoll()
Returns
Type | Description |
---|---|
System.Int32 | The miniumum possible value that could be returned by this dice expression. |
Remarks
Typically this can be implemented by calling Roll(IGenerator) and passing in a MinRandom instance.
Roll(IGenerator)
Rolls the expression using the RNG given, returning the result.
Declaration
int Roll(IGenerator rng = null)
Parameters
Type | Name | Description |
---|---|---|
Troschuetz.Random.IGenerator | rng | The RNG to use. If null is specified, the default RNG is used. |
Returns
Type | Description |
---|---|
System.Int32 | The result obtained by rolling the dice expression. |