public override void Query(object source, StatQuery sq) { if (ReferenceEquals(source, this)) { switch (sq.Type) { case Statistic.Attack: sq.Value += _baseAttack; break; case Statistic.Defense: sq.Value += _baseDefense; break; default: throw new ArgumentOutOfRangeException($"{sq.Type} out of range!"); } } else { if (sq.Type == Statistic.Defense) { sq.Value++; } } }
public override void Query(object source, StatQuery sq) { if (!ReferenceEquals(source, this) && sq.Type == Statistic.Attack) { sq.Value++; // every goblin gets +1 attack } else { base.Query(source, sq); } }
public abstract void Query(object source, StatQuery sq);