using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Jace.Operations { public abstract class Constant : Operation { public Constant(DataType dataType, T value) : base(dataType, false, true) { this.Value = value; } public T Value { get; private set; } public override bool Equals(object obj) { Constant other = obj as Constant; if (other != null) return this.Value.Equals(other.Value); else return false; } public override int GetHashCode() { return this.Value.GetHashCode(); } } public class IntegerConstant : Constant { public IntegerConstant(int value) : base(DataType.Integer, value) { } } public class FloatingPointConstant : Constant { public FloatingPointConstant(double value) : base(DataType.FloatingPoint, value) { } } }