Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class IntStat : NumericStat<Int32>
- {
- public override Int32 MaxValue { get { return Math.Min(Int32.MaxValue, MaxLimit); } }
- public override Int32 MinValue { get { return Math.Max(Int32.MinValue, MinLimit); } }
- #region IComparable
- public override int CompareTo(object obj)
- {
- if (obj == null)
- return 1;
- if(obj is Int32)
- {
- return Value.CompareTo(obj);
- }
- if(obj is DecimalStat)
- {
- return Value.CompareTo(((DecimalStat)obj).Value);
- }
- if(obj is DoubleStat)
- {
- return Value.CompareTo(((DoubleStat)obj).Value);
- }
- if(obj is FloatStat)
- {
- return Value.CompareTo(((FloatStat)obj).Value);
- }
- if(obj is ByteStat)
- {
- return Value.CompareTo(((ByteStat)obj).Value);
- }
- if(obj is SByteStat)
- {
- return Value.CompareTo(((SByteStat)obj).Value);
- }
- if(obj is ShortStat)
- {
- return Value.CompareTo(((ShortStat)obj).Value);
- }
- if(obj is UShortStat)
- {
- return Value.CompareTo(((UShortStat)obj).Value);
- }
- if(obj is IntStat)
- {
- return Value.CompareTo(((IntStat)obj).Value);
- }
- if(obj is UIntStat)
- {
- return Value.CompareTo(((UIntStat)obj).Value);
- }
- if(obj is LongStat)
- {
- return Value.CompareTo(((LongStat)obj).Value);
- }
- if(obj is ULongStat)
- {
- return Value.CompareTo(((ULongStat)obj).Value);
- }
- return Value.CompareTo(obj);
- }
- #endregion
- #region IConvertible
- public override TypeCode GetTypeCode()
- {
- return TypeCode.Int32;
- }
- public override bool ToBoolean(IFormatProvider provider)
- {
- if(Value == 0)
- return false;
- return true;
- }
- public override char ToChar(IFormatProvider provider)
- {
- return Convert.ToChar(Value);
- }
- public override sbyte ToSByte(IFormatProvider provider)
- {
- return Convert.ToSByte(Value);
- }
- public override byte ToByte(IFormatProvider provider)
- {
- return Convert.ToByte(Value);
- }
- public override short ToInt16(IFormatProvider provider)
- {
- return Convert.ToInt16(Value);
- }
- public override ushort ToUInt16(IFormatProvider provider)
- {
- return Convert.ToUInt16(Value);
- }
- public override int ToInt32(IFormatProvider provider)
- {
- return Convert.ToInt32(Value);
- }
- public override uint ToUInt32(IFormatProvider provider)
- {
- return Convert.ToUInt32(Value);
- }
- public override long ToInt64(IFormatProvider provider)
- {
- return Convert.ToInt64(Value);
- }
- public override ulong ToUInt64(IFormatProvider provider)
- {
- return Convert.ToUInt64(Value);
- }
- public override float ToSingle(IFormatProvider provider)
- {
- return Convert.ToSingle(Value);
- }
- public override double ToDouble(IFormatProvider provider)
- {
- return Convert.ToDouble(Value);
- }
- public override decimal ToDecimal(IFormatProvider provider)
- {
- return Convert.ToDecimal(Value);
- }
- public override string ToString(IFormatProvider provider)
- {
- return Convert.ToString(Value);
- }
- public override object ToType(Type conversionType, IFormatProvider provider)
- {
- return Convert.ChangeType(Value, conversionType);
- }
- #endregion
- #region Type Casting
- public static implicit operator Decimal(IntStat stat)
- {
- return Convert.ToDecimal(stat.Value);
- }
- public static explicit operator IntStat(DecimalStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(Decimal num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static implicit operator Double(IntStat stat)
- {
- return Convert.ToDouble(stat.Value);
- }
- public static explicit operator IntStat(DoubleStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(Double num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static implicit operator Single(IntStat stat)
- {
- return Convert.ToSingle(stat.Value);
- }
- public static explicit operator IntStat(FloatStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(Single num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator Byte(IntStat stat)
- {
- return Convert.ToByte(stat.Value);
- }
- public static explicit operator IntStat(ByteStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(Byte num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator SByte(IntStat stat)
- {
- return Convert.ToSByte(stat.Value);
- }
- public static implicit operator IntStat(SByteStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static implicit operator IntStat(SByte num)
- {
- IntStat stat = new IntStat();
- stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator Int16(IntStat stat)
- {
- return Convert.ToInt16(stat.Value);
- }
- public static implicit operator IntStat(ShortStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static implicit operator IntStat(Int16 num)
- {
- IntStat stat = new IntStat();
- stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator UInt16(IntStat stat)
- {
- return Convert.ToUInt16(stat.Value);
- }
- public static explicit operator IntStat(UShortStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(UInt16 num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static implicit operator Int32(IntStat stat)
- {
- return Convert.ToInt32(stat.Value);
- }
- public static implicit operator IntStat(Int32 num)
- {
- IntStat stat = new IntStat();
- stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator UInt32(IntStat stat)
- {
- return Convert.ToUInt32(stat.Value);
- }
- public static explicit operator IntStat(UIntStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(UInt32 num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static implicit operator Int64(IntStat stat)
- {
- return Convert.ToInt64(stat.Value);
- }
- public static explicit operator IntStat(LongStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(Int64 num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- public static explicit operator UInt64(IntStat stat)
- {
- return Convert.ToUInt64(stat.Value);
- }
- public static explicit operator IntStat(ULongStat stat)
- {
- return new IntStat(stat.Name, (Int32)stat.Value, (Int32)stat.MinValue, (Int32)stat.MaxValue, stat.Description, stat.Notes);
- }
- public static explicit operator IntStat(UInt64 num)
- {
- IntStat stat = new IntStat();
- if((Int32)num > stat.MaxLimit)
- stat.Set(stat.MaxLimit);
- else if((Int32)num < stat.MinLimit)
- stat.Set(stat.MinLimit);
- else stat.Set((Int32)num);
- return stat;
- }
- #endregion
- #region Operator Overloading
- public static IntStat operator +(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Decimal rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Decimal rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Decimal rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Double rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Double rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Double rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Single rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Single rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Single rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Byte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Byte rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Byte rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, SByte rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, SByte rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, SByte rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Int16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Int16 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Int16 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, UInt16 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, UInt16 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, UInt16 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Int32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Int32 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Int32 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, UInt32 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, UInt32 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, UInt32 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, Int64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, Int64 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, Int64 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- public static IntStat operator +(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value + (Int32)rhs));
- return result;
- }
- public static IntStat operator -(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value - (Int32)rhs));
- return result;
- }
- public static IntStat operator *(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value * (Int32)rhs));
- return result;
- }
- public static IntStat operator /(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value / (Int32)rhs));
- return result;
- }
- public static IntStat operator %(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)(lhs.Value % (Int32)rhs));
- return result;
- }
- public static IntStat operator ^(IntStat lhs, UInt64 rhs)
- {
- IntStat result = lhs.Copy();
- result.Set((Int32)Math.Pow((double)lhs.Value, (double)rhs));
- return result;
- }
- public static bool operator >(IntStat lhs, UInt64 rhs)
- {
- return lhs.CompareTo(rhs) > 0;
- }
- public static bool operator <(IntStat lhs, UInt64 rhs)
- {
- return lhs.CompareTo(rhs) < 0;
- }
- #endregion
- public IntStat Copy()
- {
- return new IntStat(Name, Value, MinLimit, MaxLimit, Description, Notes);
- }
- public IntStat() : this("UnnamedStat", 0, Int32.MinValue, Int32.MaxValue, null, null) { }
- public IntStat(string name) : this(name, 0, Int32.MinValue, Int32.MaxValue, null, null) { }
- public IntStat(string name, Int32 value) : this(name, value, Int32.MinValue, Int32.MaxValue, null, null) { }
- public IntStat(string name, Int32 value, Int32 min, Int32 max) : this(name, value, min, max, null, null) { }
- public IntStat(string name, Int32 value, Int32 min, Int32 max, string desc, string notes) : base(name, value, min, max, desc, notes) { }
- public override string ToString() { return Value.ToString(); }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement