public bool Equals(EffectInteger other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(base.Equals(other) && other.m_value == m_value); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { AsyncRandom asyncRandom = new AsyncRandom(); EffectBase result; if (type == EffectGenerationType.MaxEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? this.ValueMax : this.ValueMin, this); } else { if (type == EffectGenerationType.MinEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? this.ValueMin : this.ValueMax, this); } else { result = new EffectInteger(base.Id, (short)asyncRandom.Next((int)this.ValueMin, (int)(this.ValueMax + 1)), this); } } return(result); }
public override EffectBase GenerateEffect(EffectGenerationContext context, EffectGenerationType type = EffectGenerationType.Normal) { AsyncRandom asyncRandom = new AsyncRandom(); short num = (this.m_dicenum >= this.m_diceface) ? this.m_dicenum : this.m_diceface; short num2 = (this.m_dicenum <= this.m_diceface) ? this.m_dicenum : this.m_diceface; EffectBase result; if (type == EffectGenerationType.MaxEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? num : num2, this); } else { if (type == EffectGenerationType.MinEffects) { result = new EffectInteger(base.Id, (base.Template.Operator != "-") ? num2 : num, this); } else { if (num2 == 0) { if (num == 0) { result = new EffectInteger(base.Id, this.m_value, this); } else { result = new EffectInteger(base.Id, num, this); } } else { result = new EffectInteger(base.Id, (short)asyncRandom.Next((int)num2, (int)(num + 1)), this); } } } return(result); }
public bool Equals(EffectInteger other) { return(!object.ReferenceEquals(null, other) && (object.ReferenceEquals(this, other) || (base.Equals(other) && other.m_value == this.m_value))); }
public EffectInteger(EffectInteger copy) : this(copy.Id, copy.Value, copy) { }