/// <summary> /// reset /// </summary> public void ResetGame() { gameOver = false; chessMove = true; if (hasLoad) { return; } if (hasLoad) { return; } chessBoard = new int[10, 9] { { 2, 3, 6, 5, 1, 5, 6, 3, 2 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 4, 0, 0, 0, 0, 0, 4, 0 }, { 7, 0, 7, 0, 7, 0, 7, 0, 7 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 14, 0, 14, 0, 14, 0, 14, 0, 14 }, { 0, 11, 0, 0, 0, 0, 0, 11, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 9, 10, 13, 12, 8, 12, 13, 10, 9 } }; boardGrid = new GameObject[10, 9]; if (chessPeople == 1 || chessPeople == 2) { boardGo = boardGos[0]; } else { boardGo = boardGos[1]; } InitGrid(); InitChess(); rules = new Rules(); movingOfChess = new MovingOfChess(this); checkmate = new Checkmate(); chessReseting = new ChessReseting(); chessReseting.resetCount = 0; chessReseting.chessSteps = new ChessReseting.Chess[400]; canMoveUIStack = new Stack <GameObject>(); for (int i = 0; i < 40; i++) { canMoveUIStack.Push(Instantiate(canMovePosUIGo)); } currentCanMoveUIStack = new Stack <GameObject>(); searchEngine = new SearchEngine(); hasLoad = true; }
/// <summary> /// 重置游戏 /// </summary> public void ResetGame() { chessMove = true; chessBoard = new int[10, 9] { { 2, 3, 6, 5, 1, 5, 6, 3, 2 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 4, 0, 0, 0, 0, 0, 4, 0 }, { 7, 0, 7, 0, 7, 0, 7, 0, 7 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 14, 0, 14, 0, 14, 0, 14, 0, 14 }, { 0, 11, 0, 0, 0, 0, 0, 11, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 9, 10, 13, 12, 8, 12, 13, 10, 9 } }; boardGrid = new GameObject[10, 9]; if (chessPeople == 1 || chessPeople == 2) { boardGo = boardGos[0]; } else { boardGo = boardGos[1]; } InitGrid(); InitChess(); rules = new Rules(); movingOfChess = new MovingOfChess(this); chessRegreting = new ChessRegreting { regretCount = 0, chessSteps = new ChessRegreting.Chess[400] }; checkmate = new Checkmate(); canMoveUIStack = new Stack <GameObject>(); for (int i = 0; i < Constants.canMoveUIStackLength; i++) { canMoveUIStack.Push(Instantiate(canMovePosUIGo)); } currentCanMoveUIStack = new Stack <GameObject>(); }