public Machine(SetupArgs args) { args.Validate(); plugboard = new Plugboard(args.LetterSet, args.Steckering); rotors = new RotorCollection(args.LetterSet, args.RotorCount); LetterSet = args.LetterSet; UnmappedHandling = args.UnmappedHandling; InvalidCharacter = args.InvalidCharacter; RotateOnInvalid = args.RotateOnInvalid; ResetAfter = args.ResetAfter; }
public Enigma() { plugboard = new Plugboard(); selectedRotors = new List <Rotor>(); rotors = new List <Rotor>() { new Rotor("EKMFLGDQVZNTOWYHXUSPAIBRCJ", 'Q', "I"), new Rotor("AJDKSIRUXBLHWTMCQGZNPYFVOE", 'E', "II"), new Rotor("BDFHJLCPRTXVZNYEIWGAKMUSQO", 'V', "III"), new Rotor("ESOVPZJAYQUIRHXLNFTGKDCMWB", 'J', "IV"), new Rotor("VZBRGITYUPSDNHLXAWMJQOFECK", 'Z', "V") }; reflector = new Reflector("YRUHQSLDPXNGOKMIEBFZCWVJAT"); }
private void plugboardLabel_Click(object sender, EventArgs e) { SetPlugboard setPlugboard = new SetPlugboard(plugboard); var result = setPlugboard.ShowDialog(); if (result == DialogResult.OK) { plugboard = setPlugboard.GetPlugboard; DisplayPlugboard(); } }
public void CreatePlugboard(Dictionary <char, char> plugs) { _plugboard = new Plugboard(plugs); }