Class ConstantTerm
Base term -- represents a numerical constant.
Inheritance
System.Object
ConstantTerm
Implements
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)
Namespace: GoRogue.DiceNotation.Terms
Assembly: GoRogue.dll
Syntax
public class ConstantTerm : ITerm
Constructors
| Improve this Doc View SourceConstantTerm(Int32)
Constructor. Takes the numerical constant it represents.
Declaration
public ConstantTerm(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The numerical value this term represents. |
Methods
| Improve this Doc View SourceGetResult(IGenerator)
Returns the numerical constant it represents. RNG is unused.
Declaration
public int GetResult(IGenerator rng)
Parameters
Type | Name | Description |
---|---|---|
Troschuetz.Random.IGenerator | rng | (Unused) rng. |
Returns
Type | Description |
---|---|
System.Int32 | The numerical constant this term represents. |
ToString()
Returns a string representation of this constant.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The numerical constant being represented, as a string. |
Overrides
System.Object.ToString()