Example #1
0
        public override DustObject Multiply(DustObject other)
        {
            if (other is DustInt)
            {
                return(new DustString(string.Concat(Enumerable.Repeat(Value, other.ToInt()))));
            }

            return(base.Multiply(other));
        }
Example #2
0
        public override DustObject Subtract(DustObject other)
        {
            if (other is DustString)
            {
                return(new DustString(Value.Replace(other.ToString(), "")));
            }

            return(base.Subtract(other));
        }
Example #3
0
        public override DustObject Divide(DustObject other)
        {
            if (other is DustInt)
            {
                throw new NotImplementedException("Arrays are not implemented");
            }

            if (other is DustString)
            {
                throw new NotImplementedException("Arrays are not implemented");
            }

            return(base.Divide(other));
        }
Example #4
0
 public override DustObject Divide(DustObject other)
 {
     return(new DustFloat(Value / other.ToFloat()));
 }
Example #5
0
 public override DustObject Multiply(DustObject other)
 {
     return(new DustFloat(Value * other.ToFloat()));
 }
Example #6
0
 public override DustObject Subtract(DustObject other)
 {
     return(new DustFloat(Value - other.ToFloat()));
 }
Example #7
0
 public override DustObject Add(DustObject other)
 {
     return(new DustFloat(Value + other.ToFloat()));
 }
Example #8
0
 public override DustObject Divide(DustObject other)
 {
     return(new DustDouble(Value / other.ToDouble()));
 }
Example #9
0
 public override DustObject Multiply(DustObject other)
 {
     return(new DustDouble(Value * other.ToDouble()));
 }
Example #10
0
 public override DustObject Subtract(DustObject other)
 {
     return(new DustDouble(Value - other.ToDouble()));
 }
Example #11
0
 public override DustObject Add(DustObject other)
 {
     return(new DustDouble(Value + other.ToDouble()));
 }
Example #12
0
 public virtual DustObject Divide(DustObject other)
 {
     return(null);
 }
Example #13
0
 public virtual DustObject Multiply(DustObject other)
 {
     return(null);
 }
Example #14
0
 public virtual DustObject Subtract(DustObject other)
 {
     return(null);
 }
Example #15
0
 public virtual DustObject Add(DustObject other)
 {
     return(null);
 }
Example #16
0
 public override DustObject Add(DustObject other)
 {
     return(new DustString(Value + other.ToString()));
 }