Rotor.notch

The turnover point for the adjacent rotor
This commit is contained in:
Eryn Wells 2015-07-19 08:20:55 -07:00
parent 00328dd0c3
commit ed6d06015d

View file

@ -128,6 +128,15 @@ class Rotor: FixedRotor {
}
}
/** An offset at which the adjacent rotor should be advanced by one position. */
var notch: Int? {
willSet {
if let newInt = newValue {
self.notch = newInt % series.count
}
}
}
func advance(count: Int = 1) {
position = (position + count) % Rotor.alphabet.count
}