Show / Hide Table of Contents

Class SubtractTerm

Term representing the subtraction operator -- subtracts the second term from the first.

Inheritance
object
SubtractTerm
Implements
ITerm
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: GoRogue.DiceNotation.Terms
Assembly: GoRogue.dll
Syntax
[DataContract]
public class SubtractTerm : ITerm

Constructors

View Source

SubtractTerm(ITerm, ITerm)

Constructor. Takes the two terms to subtract.

Declaration
public SubtractTerm(ITerm term1, ITerm term2)
Parameters
Type Name Description
ITerm term1

The first term (left-hand side).

ITerm term2

The second term (right-hand side).

Fields

View Source

Term1

The first term (left-hand side).

Declaration
[DataMember]
public readonly ITerm Term1
Field Value
Type Description
ITerm
View Source

Term2

The second term (right-hand side).

Declaration
[DataMember]
public readonly ITerm Term2
Field Value
Type Description
ITerm

Methods

View Source

GetResult(IEnhancedRandom)

Subtracts the second term from the first, evaluating those two terms as necessary.

Declaration
public int GetResult(IEnhancedRandom rng)
Parameters
Type Name Description
IEnhancedRandom rng

The rng to used -- passed to other terms.

Returns
Type Description
int

The result of evaluating Term1 - Term2.

View Source

ToString()

Returns a parenthesized string representing the operation.

Declaration
public override string ToString()
Returns
Type Description
string

A parenthesized string representing the operation.

Overrides
object.ToString()

Implements

ITerm

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX