Exemple #1
0
        }//end

        /*
         * Overriding the effect method.
         * The method moves the pawn to a given position (destination) passed
         * at the time of creation
         */
        public override void effect(GameBoard t, Pawn p, EventHandler <ArgEvent <Pawn> > _event)
        {
            int shot = p.move(_destination - p.position);

            t.move(p, shot);
            _event.Invoke(this, new ArgEvent <Pawn>(p));
        }
Exemple #2
0
 /* Override the effect method.
  * The method moves the pawn by n positions equal to the shot
  * carried out previously.
  */
 public override void effect(GameBoard t, Pawn p, EventHandler <ArgEvent <Pawn> > _event)
 {
     if (!p.winner)
     {
         int shot = p.move(p.shotPreviously);
         t.move(p, shot);
     }
     _event.Invoke(this, new ArgEvent <Pawn>(p));
 }