Class AddTerm
Term representing the addition operator -- adds two terms together.
Inheritance
System.Object
AddTerm
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 AddTerm : ITerm
Constructors
| Improve this Doc View SourceAddTerm(ITerm, ITerm)
Constructor. Takes the two terms to add.
Declaration
public AddTerm(ITerm term1, ITerm term2)
Parameters
Type | Name | Description |
---|---|---|
ITerm | term1 | Left-hand side. |
ITerm | term2 | Right-hand side. |
Properties
| Improve this Doc View SourceTerm1
First term (left-hand side).
Declaration
public ITerm Term1 { get; }
Property Value
Type | Description |
---|---|
ITerm |
Term2
Second term (right-hand side).
Declaration
public ITerm Term2 { get; }
Property Value
Type | Description |
---|---|
ITerm |
Methods
| Improve this Doc View SourceGetResult(IGenerator)
Adds its two terms together, evaluating those two terms as necessary.
Declaration
public int GetResult(IGenerator rng)
Parameters
Type | Name | Description |
---|---|---|
Troschuetz.Random.IGenerator | rng | The rng to use, passed to other terms. |
Returns
Type | Description |
---|---|
System.Int32 |
ToString()
Converts to a parenthesized string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A parenthesized string representing the term. |
Overrides
System.Object.ToString()