コード例 #1
0
ファイル: King.cs プロジェクト: hbentz/ChessTreePlanner
 public void AddMoveIfLegal(int x, int y, ref ChessTile[,] tiles, ref bool[,] moveArray)
 {
     if (MoveOnBoard(x, y))
     {
         ChessTile toTile           = tiles[x, y];
         bool      noThreatAndEmpty = toTile.ThreatenedBy(isBlack).Count == 0 && !toTile.HasPiece();
         bool      canTake          = toTile.HasEnemyPiece(isBlack) && toTile.Figure.ProtectedBy().Count == 0;
         moveArray[x, y] = noThreatAndEmpty || canTake;
     }
 }