public static GameState New(Words words, string playerName) { var random = new Random(); var startsWith = new StartsWith('n', 'o'); var charBoard = CharBoard.New(random, words, startsWith, "nothing"); return(new GameState( random, words, startsWith, charBoard, Enumerable.Empty <AttemptResult>(), Player.New(playerName, random), Encounters.EnterDungeon(random), Enumerable.Empty <Item>(), 0 )); }
private GameState( Random random, Words words, StartsWith startsWith, CharBoard charBoard, IEnumerable <AttemptResult> attemptResults, Player player, Encounter encounter, IEnumerable <Item> itemsEscrow, int xpEscrow) { Random = random; Words = words; StartsWith = startsWith; CharBoard = charBoard; AttemptResults = attemptResults; Player = player; Encounter = encounter; LootEscrow = itemsEscrow; XPEscrow = xpEscrow; // Debug.WriteLine(string.Join("\n", CharBoard.PossibleWords.Select(c => c.Value).OrderBy(c => c.Length))); }
public static CharBoard New(Random random, Words words, StartsWith startsWith, Word forceInclude = null) { var wordSet = words.GetWordsThatStartWith(startsWith); return(ConstructBoard(wordSet, random, forceInclude)); }