public PieceView(BoardView boardView, string imgName) { this.boardView = boardView; img = Resource.Load(imgName); moveAnim = new Animation(Chess.ChessView, speed, true); moveAnim.AnimationEvent += MovedEvent; }
public Chess() { InitializeComponent(); ChessView = board; gameManager = new GameManager(); boardView = new BoardView(); boardView.PieceMovedStopEvent = PieceMovedStoped; boardView.ResetSize(board.Width, board.Height); }
void ContinueGame(Chessboard recordChessBoard) { boardView.Destory(); isPause = false; boardView = new BoardView(); boardView.PlaceEndEvent = PlaceEnd; boardView.PieceMovedStopEvent = PieceMovedStoped; boardView.CreateBoardPieces(recordChessBoard); boardView.ResetSize(board.Width, board.Height); recordNode = recordNode.Next; recordIdx++; ChessView.Refresh(); }
void StartGame() { boardView.Destory(); recordIdx = 0; isPause = false; recordNode = null; gameManager.CreateGame(); gameManager.Play(); chessboard = gameManager.orgChessBoard; recordMgr = gameManager.recordMgr; boardView = new BoardView(); boardView.PlaceEndEvent = PlaceEnd; boardView.PieceMovedStopEvent = PieceMovedStoped; boardView.CreateBoardPieces(chessboard, 1000); boardView.ResetSize(board.Width, board.Height); ChessView.Refresh(); AddRecordToListBox(); }