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; }
/// <summary> /// Reads the file and returns the <see cref="int[]"/> plugboard steckering. /// </summary> /// <param name="letterSet">The letterset to reference the index of the characters.</param> /// <param name="plugboardFile">The file containing the plugboard setup.</param> /// /// <exception cref="Exception"> /// A file has invalid formatting, a parsed letter was invalid, or mismatched characters. /// </exception> private void LoadFromFile(LetterSet letterSet, string plugboardFile) { Steckering = PlugboardIO.Read(letterSet.Count, plugboardFile); }