/// <summary> /// Constructor for the Rotor class. Uses the RotorSettings class to initialize. /// </summary> /// <param name="settings">The set of rotor settings this rotor should use.</param> public Rotor(RotorSettings settings) { Offset = settings.Offset; rotation = settings.Rotation; originalRotation = settings.Rotation; toRotateNext = settings.ToRotateNext; }
public void SetRotor(int n, RotorSettings rotorSettings) { if (n < rotors.Length) { rotors[n].SetSettings(rotorSettings); } rotors[n].Refresh(); }
public EnigmaSettings GetSettings() { var rotorSettings = new RotorSettings[this.rotors.Length]; for (int i = 0; i < this.rotors.Length; i++) { rotorSettings[i] = this.rotors[i].GetSettings(); } var enigmaSettings = new EnigmaSettings(rotorSettings, this.reflector.GetSettings(), this.plugBoard.GetSettings()); return(enigmaSettings); }
public void SetReflector(RotorSettings reflector) { this.reflector.SetSettings(reflector); }
public void SetSettings(RotorSettings rotorSettings) { this.wiring = rotorSettings.wiring; this.notch = rotorSettings.notch; this.offset = rotorSettings.offset; }
public RotorSettings GetSettings() { var rotorSetting = new RotorSettings(this.wiring, this.notch, this.offset); return(rotorSetting); }
public Rotor(RotorSettings rotorSettings) { this.wiring = rotorSettings.wiring; this.notch = rotorSettings.notch; }