/// <summary> /// Initializes a new instance of the <see cref="Round"/> class. /// </summary> /// <param name="players">The players<see cref="List{Player}"/>.</param> /// <param name="phraseGenerator">The phraseGenerator<see cref="IPhraseGenerator"/>.</param> /// <param name="captureInput">The captureInput<see cref="ICaptureInput"/>.</param> public Round(List <Player> players, IPhraseGenerator phraseGenerator, ICaptureInput captureInput) { this.Players = players; this.PhraseGenerator = phraseGenerator; this.CaptureInput = captureInput; LLPlayers = new LinkedList <Player>(); foreach (var player in Players) { var node = new LinkedListNode <Player>(player); LLPlayers.AddLast(node); } }
/// <summary> /// Initializes a new instance of the <see cref="Options"/> class. /// </summary> /// <param name="config">The shared configuration object to be updated.</param> public Options(UserConfig config) : this() { this.config = config; this.presentationConfig = new UserConfig(); this.generator = new PhraseGenerator( this.presentationConfig, new PresentationPhraseRepository(this.presentationConfig), new PresentationSpecialCharsRepository()); DicewareFileType[] wordLists = { DicewareFileType.Short, DicewareFileType.Long }; this.uxWordlistComboBox.DataSource = wordLists; this.uxNumberOfWords.Value = config.NumberOfWords; this.uxStudlyCapsCheckBox.Checked = config.StudlyCaps; this.uxWordlistComboBox.SelectedItem = config.Wordlist; this.uxSeparatorText.Text = config.Separator; this.uxSpecialCharsCheckBox.Checked = config.SpecialChars; this.UpdatePreview(); }
/// <summary> /// The GeneratePuzzle. /// </summary> /// <param name="phraseGenerator">The phraseGenerator<see cref="IPhraseGenerator"/>.</param> private void GeneratePuzzle(IPhraseGenerator phraseGenerator) { PuzzlePhrase = phraseGenerator.Generate(); }
/// <summary> /// Initializes a new instance of the <see cref="Puzzle"/> class. /// </summary> /// <param name="phraseGenerator">The phraseGenerator<see cref="IPhraseGenerator"/>.</param> public Puzzle(IPhraseGenerator phraseGenerator) { GuessedLetters = new Dictionary <char, bool>(); GeneratePuzzle(phraseGenerator); GenerateGuessedLetters(); }