Пример #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));
        }
Пример #2
0
        public override DustObject Subtract(DustObject other)
        {
            if (other is DustString)
            {
                return(new DustString(Value.Replace(other.ToString(), "")));
            }

            return(base.Subtract(other));
        }
Пример #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));
        }
Пример #4
0
 public override DustObject Divide(DustObject other)
 {
     return(new DustFloat(Value / other.ToFloat()));
 }
Пример #5
0
 public override DustObject Multiply(DustObject other)
 {
     return(new DustFloat(Value * other.ToFloat()));
 }
Пример #6
0
 public override DustObject Subtract(DustObject other)
 {
     return(new DustFloat(Value - other.ToFloat()));
 }
Пример #7
0
 public override DustObject Add(DustObject other)
 {
     return(new DustFloat(Value + other.ToFloat()));
 }
Пример #8
0
 public override DustObject Divide(DustObject other)
 {
     return(new DustDouble(Value / other.ToDouble()));
 }
Пример #9
0
 public override DustObject Multiply(DustObject other)
 {
     return(new DustDouble(Value * other.ToDouble()));
 }
Пример #10
0
 public override DustObject Subtract(DustObject other)
 {
     return(new DustDouble(Value - other.ToDouble()));
 }
Пример #11
0
 public override DustObject Add(DustObject other)
 {
     return(new DustDouble(Value + other.ToDouble()));
 }
Пример #12
0
 public virtual DustObject Divide(DustObject other)
 {
     return(null);
 }
Пример #13
0
 public virtual DustObject Multiply(DustObject other)
 {
     return(null);
 }
Пример #14
0
 public virtual DustObject Subtract(DustObject other)
 {
     return(null);
 }
Пример #15
0
 public virtual DustObject Add(DustObject other)
 {
     return(null);
 }
Пример #16
0
 public override DustObject Add(DustObject other)
 {
     return(new DustString(Value + other.ToString()));
 }