From f89f308c525e9deebc6d2cf6416e27dfe1a299dc Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 16:03:38 +0200 Subject: Cleanup DiscoBot Project --- DiscoBot/Auxiliary/Calculator/Operator.cs | 50 ------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 DiscoBot/Auxiliary/Calculator/Operator.cs (limited to 'DiscoBot/Auxiliary/Calculator/Operator.cs') diff --git a/DiscoBot/Auxiliary/Calculator/Operator.cs b/DiscoBot/Auxiliary/Calculator/Operator.cs deleted file mode 100644 index 0928ec2..0000000 --- a/DiscoBot/Auxiliary/Calculator/Operator.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; - -namespace DiscoBot.Auxiliary.Calculator -{ - /// - /// The Operator Class represents a binary operator with tow Arguments and an Operation type - /// - public class Operator : ISolvable - { - private readonly ISolvable arg1, arg2; - - public Operator(ISolvable arg1, ISolvable arg2, Ops operatorType) - { - this.arg1 = arg1; - this.arg2 = arg2; - this.OperatorType = operatorType; - } - - public Ops OperatorType { get; set; } - - public int Solve() - { - int result; - switch (this.OperatorType) - { - case Ops.Dice: - result = Dice.Roll(this.arg1.Solve(), this.arg2.Solve()); - break; - case Ops.Multiply: - result = this.arg1.Solve() * this.arg2.Solve(); - break; - case Ops.Add: - result = this.arg1.Solve() + this.arg2.Solve(); - break; - case Ops.Subtract: - result = this.arg1.Solve() - this.arg2.Solve(); - break; - default: - throw new ArgumentOutOfRangeException(); - } - - return result; - } - - public override string ToString() - { - return $"({this.arg1} {this.OperatorType} {this.arg2})"; - } - } -} -- cgit v1.2.3-54-g00ecf