示例#1
0
 public override bool moveTo(Square s)
 {
     if (s != null)
     {
         if (s.isWalkable())
         {
             if (s.mayContainBarricade())
             {
                 if (s.isOccupied())
                 {
                     return false;
                 }
                 else
                 {
                     s.Piece = this;
                     Square = s;
                     Player.Baricade = null;
                     Player = null;
                     return true;
                 }
             }
         }
     }
     return false;
 }
示例#2
0
文件: Pawn.cs 项目: spboom/Baricade
 public override bool moveTo(Square s)
 {
     if (s != null)
     {
         if (s.isWalkable())
         {
             if (s.mayContainPawn())
             {
                 if (s.isOccupied())
                 {
                     return s.Piece.isHit(this);
                 }
                 else
                 {
                     Square.removePawn(this);
                     s.setPawn(this);
                     return true;
                 }
             }
         }
     }
     return false;
 }