Class DiceHand
Represents a "handful of dice."
Inheritance
System.Object
DiceHand
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: osrlib.Dice
Assembly: osrlib.Core.dll
Syntax
public class DiceHand
Remarks
The DiceHand is a type representation of the well-known NdN format for a handful of dice. For example, "1d20", "3d6", or "4d8." It is the preferred parameter for use in the creation of a DiceRoll. Create a DiceHand, add it to a DiceRoll, then call its RollDice() method to get the result.
Examples
// Roll one twenty-sided die
DiceHand hand = new DiceHand(1, DieType.d20);
DiceRoll roll = new DiceRoll(hand);
int result = roll.RollDice();
Constructors
| Improve this Doc View SourceDiceHand(Int32, DieType)
Creates a new instance of DiceHand, appropriate for passing to the DiceRoll constructor.
Declaration
public DiceHand(int count, DieType sides)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | The number of Dice in the DiceHand - the first value in the '#d#' format (the '3' in 3d6). |
DieType | sides | The number of sides per Die in the DiceHand. |
Properties
| Improve this Doc View SourceDieCount
Gets or sets the number of dice in the DiceHand.
Declaration
public int DieCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
DieSides
Gets or sets the number of sides of each die in the DiceHand.
Declaration
public DieType DieSides { get; set; }
Property Value
Type | Description |
---|---|
DieType |