예제 #1
0
파일: Board.cs 프로젝트: Aladewale/games
        public Board(Control board, Control wKilled, Control bKilled, bool inverted)
        {
            this.board = board; this.wKilled = wKilled; this.bKilled = bKilled;
            this.inverted = inverted;
            for (int x = 1; x < 9; x++) for (int y = 1; y < 9; y++) AllSquares[x, y] = new Square(board, x, y, inverted);

            foreach (var item in pieces)
            {
                var piece = new Piece(board, item.Key, inverted) { Square = AllSquares[item.Value.X, item.Value.Y] };
                piece.BeforeMove += new EventHandler<PieceEventArgs>(piece_BeforeMove);
                piece.Move += new EventHandler<PieceEventArgs>(piece_Move);
                AllPieces.Add(piece);
            }
        }
예제 #2
0
 public MoveResolver(List<Square> list, Piece piece, Square[,] s, List<PieceId> moved)
 {
     o = list; p = piece; this.s = p.Square; squares = s; this.moved = moved;
 }