Пример #1
0
 public EnigmaService(DiscordBotServiceContainer services,
                      ConfigParserService configParser) : base(services)
 {
     letterSet             = LetterSetIO.Read(LetterSetFile);
     steckering            = PlugboardIO.Read(letterSet.Count, PlugboardFile);
     rotorKeys             = RotorIO.Read(RotorKeysFile);
     this.configParser     = configParser;
     Client.ReactionAdded += OnReactionAddedAsync;
 }
Пример #2
0
 /// <summary>
 /// Reads the file and returns the <see cref="LetterSet"/>.
 /// </summary>
 /// <param name="letterSetFile">The file containing the letterset.</param>
 ///
 /// <exception cref="Exception">
 /// A parsed letter is invalid.
 /// </exception>
 private void LoadFromFile(string letterSetFile)
 {
     LetterSet = LetterSetIO.Read(letterSetFile);
 }