Ejemplo n.º 1
0
        public LOGameState Create(LOGameBoard gameBoard, GameInitData initData)
        {
            LOGameState loGameState = gameBoard.CreateFirstState(initData);

            do
            {
                for (int i = 0; i < initData.randomShuffleFactor; ++i)
                {
                    loGameState = gameBoard.MakeRandomMove(loGameState);
                }
            } while (loGameState.isWon); // if randomization ends up solving the game, re-randomize

            return(loGameState);
        }
Ejemplo n.º 2
0
 LOGameState(LOGameState gameState)
 {
     isWon      = gameState.isWon;
     dimensions = gameState.dimensions.Copy();
     boardState = gameState.boardState.Copy();
 }