Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 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");
 }
Esempio n. 3
0
 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();
     }
 }
Esempio n. 4
0
 public void CreatePlugboard(Dictionary <char, char> plugs)
 {
     _plugboard = new Plugboard(plugs);
 }