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++;
                }
            }
        }
Esempio n. 2
0
 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);