Beispiel #1
0
        public Machine(MachineType type)
        {
            MachineType = type;

            AvailableReflectors = new ReflectorList(MachineType);
            AvailableRotors     = new RotorList(MachineType);

            _stecker = new Stecker();
            _rotors  = new List <Rotor>();

            if (type == MachineType.M3 || type == MachineType.M3K)
            {
                _reflector = new Reflector(ReflectorType.B);

                _rotors.Add(AvailableRotors[RotorName.III]);
                _rotors.Add(AvailableRotors[RotorName.II]);
                _rotors.Add(AvailableRotors[RotorName.I]);
            }
            else
            {
                _reflector = new Reflector(ReflectorType.B_Dunn);

                _rotors.Add(AvailableRotors[RotorName.III]);
                _rotors.Add(AvailableRotors[RotorName.II]);
                _rotors.Add(AvailableRotors[RotorName.I]);
                _rotors.Add(AvailableRotors[RotorName.Beta]);
            }
        }
Beispiel #2
0
 void Opstarten()
 {
     Rotors = new Rotor[5];
     for (int i = 0; i < 5; i++)
     {
         Rotors[i] = new Rotor();
         if (i < 3)
         {
             Rotors[i].myCode = i + 1;
         }
         Rotors[i].EncryptionIndex = (byte)i;
     }
     StekkerDoos = new Stecker();
     Spiegel     = new Spiegel();
 }