예제 #1
0
        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++;
                }
            }
        }
예제 #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);
     }
 }
예제 #3
0
 public abstract void Query(object source, StatQuery sq);