Class AddTerm
Term representing the addition operator -- adds two terms together.
Implements
Inherited Members
Namespace: GoRogue.DiceNotation.Terms
Assembly: GoRogue.dll
Syntax
[DataContract]
public class AddTerm : ITerm
Constructors
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. |
Fields
View SourceTerm1
First term (left-hand side).
Declaration
[DataMember]
public readonly ITerm Term1
Field Value
Type | Description |
---|---|
ITerm |
Term2
Second term (right-hand side).
Declaration
[DataMember]
public readonly ITerm Term2
Field Value
Type | Description |
---|---|
ITerm |
Methods
View SourceGetResult(IEnhancedRandom)
Adds its two terms together, evaluating those two terms as necessary.
Declaration
public int GetResult(IEnhancedRandom rng)
Parameters
Type | Name | Description |
---|---|---|
IEnhancedRandom | rng | The rng to use, passed to other terms. |
Returns
Type | Description |
---|---|
int |
ToString()
Converts to a parenthesized string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A parenthesized string representing the term. |