public override void Query(object source, StatQuery sq) { if (ReferenceEquals(source, this)) { switch (sq.Statistic) { case Statistic.Attack: sq.Result += baseAttack; break; case Statistic.Defense: sq.Result += baseDefense; break; default: throw new ArgumentOutOfRangeException(); } } else { if (sq.Statistic == Statistic.Defense) { sq.Result++; } } }
public override void Query(object source, StatQuery sq) { if (!ReferenceEquals(source, this) && sq.Statistic == Statistic.Attack) { sq.Result++; // every goblin gets +1 attack } else { base.Query(source, sq); } }
public abstract void Query(object source, StatQuery sq);