Example #1
0
        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();
        }
        public void CreateGame()
        {
            recordMgr = new RecordManager(this);

            chessBoard        = new Chessboard();
            chessBoard.XCount = ChessBoardXCount;
            chessBoard.YCount = ChessBoardYCount;
            chessBoard.Create();

            players = new Player[2]
            {
                new Player(chessBoard),
                new Player(chessBoard)
            };



            curtPlayPlayerIdx = -1;
            CreateRandomIdxTable();
            CreatePlayersBoardPieces();
            orgChessBoard = Tools.Instance.DeepCopyByBinary <Chessboard>(chessBoard);
        }