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); } }
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; }