/// <summary> /// Adds its two terms together, evaluating those two terms as necessary. /// </summary> /// <param name="rng">The rng to use, passed to other terms.</param> /// <returns>The result of adding <see cref="Term1"/> and <see cref="Term2"/>.</returns> public int GetResult(IGenerator rng) { return(Term1.GetResult(rng) + Term2.GetResult(rng)); }
/// <summary> /// Subtracts the second term from the first, evaluating those two terms as necessary. /// </summary> /// <param name="rng">The rng to used -- passed to other terms.</param> /// <returns>The result of evaluating Term1 - Term2.</returns> public int GetResult(IRandom rng) { return(Term1.GetResult(rng) - Term2.GetResult(rng)); }
/// <summary> /// Divides the first term by the second, evaluating those two terms as necessary. /// </summary> /// <param name="rng">The rng to used -- passed to other terms.</param> /// <returns>The result of evaluating <see cref="Term1"/> / <see cref="Term2"/>.</returns> public int GetResult(IGenerator rng) { return((int)Math.Round((double)Term1.GetResult(rng) / Term2.GetResult(rng))); }
/// <summary> /// Divides the first term by the second, evaluating those two terms as necessary. /// </summary> /// <param name="rng">The rng to used -- passed to other terms.</param> /// <returns>The result of evaluating Term1 / Term2.</returns> public int GetResult(IRandom rng) { return((int)Math.Round((double)Term1.GetResult(rng) / Term2.GetResult(rng))); }