Ejemplo n.º 1
0
 public Game(Dictionary<int, Type> white, Dictionary<int, Type> black,
     int files, int columns, int promo, Piece[] pieces)
 {
     Initialise (white, black, files, columns, promo, pieces);
 }
Ejemplo n.º 2
0
 public Piece[] Pieces()
 {
     Piece[] pieceObjects = new Piece[pieces.Count];
     for(int i = 0; i < pieces.Count; ++i)
         pieceObjects[i] = Piece.getObject[pieces[i]];
     return pieceObjects;
 }
Ejemplo n.º 3
0
        private void Initialise(Dictionary<int, Type> white, Dictionary<int, Type> black,
            int files, int columns, int promo, Piece[] pieces)
        {
            this.files = files;
            this.columns = columns;
            this.pieces = pieces;

            generateInitialSetup (white, black);
            generateMoveSets ();

            // Create the masks for both player's promotion zones
            Bits whitePromo = 0;
            Bits blackPromo = 0;
            for (int j = 0; j < promo; ++j) {
                for (int i = 0; i < columns; ++i) {
                    B.Set (ref whitePromo, (files - 1 - j) * columns + i);
                    B.Set (ref blackPromo, j * columns + i);
                }
            }
            promoMask = new Bits[2];
            promoMask [0] = whitePromo;
            promoMask [1] = blackPromo;
        }