public override void Modulo(BaseType value) { this.value %= value.ToFloat(); OnChanged(); }
public override void Assign(BaseType value) { this.value = value.ToFloat(); OnChanged(); }
public override void Divide(BaseType value) { this.value /= value.ToFloat(); OnChanged(); }
public override void Power(BaseType value) { this.value = (long) Math.Pow((double)this.value, (double) value.ToFloat()); OnChanged(); }
public override void Multiply(BaseType value) { this.value *= value.ToFloat(); OnChanged(); }
public override void Subtract(BaseType value) { this.value -= value.ToFloat(); OnChanged(); }
public override void Add(BaseType value) { this.value += value.ToFloat(); OnChanged(); }
public override bool IsLessThan(BaseType value) { return this.value < value.ToFloat(); }
/// <summary> /// Transforms a Psimulex type to its closest .NET equivalent. /// It is mainly utilized by the SystemCall mechanism. /// </summary> /// <param name="value"></param> /// <param name="type"></param> /// <returns></returns> public static object TransformToDotnetType(BaseType value, Type type) { if (TypeEquals(type, typeof(BaseType))) { return value; } else if (type.IsSubclassOf(typeof(BaseType))) { return value.ConvertTo(GetTypeEnumOfType(type)); } else if (TypeEquals(type, typeof(string))) { return value.ToString(); } else if (TypeEquals(type, typeof(int))) { return (int) value.ToInt(); } else if (TypeEquals(type, typeof(long))) { return value.ToInt(); } else if (TypeEquals(type, typeof(decimal))) { return value.ToDecimal(); } else if (TypeEquals(type, typeof(float))) { return value.ToFloat(); } else if (TypeEquals(type, typeof(bool))) { return value.ToBoolean(); } else if (TypeEquals(type, typeof(char))) { return value.ToChar(); } else return null; }