Пример #1
0
 private void AddPieces(PlayerPieceSet pieces, Players player)
 {
     Debug.Assert(pieces != null);
     AddPiece(player, Exports.Pieces.King, pieces.KingsCell);
     for (uint i = 0, e = pieces.QueensCount; i < e; ++i)
     {
         AddPiece(player, Exports.Pieces.Queen, pieces.GetQueenCell(i));
     }
     for (uint i = 0, e = pieces.RooksCount; i < e; ++i)
     {
         AddPiece(player, Exports.Pieces.Rook, pieces.GetRookCell(i));
     }
     for (uint i = 0, e = pieces.BishopsCount; i < e; ++i)
     {
         AddPiece(player, Exports.Pieces.Bishop, pieces.GetBishopCell(i));
     }
     for (uint i = 0, e = pieces.KnightsCount; i < e; ++i)
     {
         AddPiece(player, Exports.Pieces.Knight, pieces.GetKnightCell(i));
     }
     for (uint i = 0, e = pieces.PawnsCount; i < e; ++i)
     {
         AddPiece(player, Exports.Pieces.Pawn, pieces.GetPawnCell(i));
     }
 }
Пример #2
0
 private static void MakeQueeenMoves(PlayerPieceSet my_pieces,
     PlayerPieceSet other_pieces, List<Move> moves)
 {
     for (uint i = 0, e = my_pieces.QueensCount; i < e; ++i)
     {
         uint cell_index;
         int queen_cell = my_pieces.GetQueenCell(i, out cell_index);
         MakeHorizVertMoves(Exports.Pieces.Queen, my_pieces, other_pieces,
             queen_cell, moves);
         MakeDiagonalMoves(Exports.Pieces.Queen, my_pieces, other_pieces,
             queen_cell, cell_index, moves);
     }
 }