private bool CanNavigateDown() { int newIndex = currentPoint.Index + GameInformation.HorizontalDimension; return((newIndex < GameInformation.FieldLetters.Length && !occupationField[newIndex]) && wordStateMachine.CanNavigateForward(GameInformation.FieldLetters[newIndex])); }
private IEnumerable <GameState> CreateGameStates(GameState gameState, IWordStateMachine wordStateMachine) { for (int index = 0; index < gameState.OccupationField.Length; index++) { GamePoint startGamePoint = new GamePoint(gameState.GameInformation, index); wordStateMachine.Reset(); if (wordStateMachine.CanNavigateForward(startGamePoint.ToChar()) && !gameState.OccupationField[startGamePoint.Index]) { TemporaryGameState temporaryGameState = new TemporaryGameState(gameState, startGamePoint, wordStateMachine); foreach (var newGameState in CreateGameStates(temporaryGameState)) { yield return(newGameState); } } } }