The positions of the master and the secondary controller, of the analog
controller and of the lights selector, the occupied cab, the horns, the radio
and its fuse, the radio-stop, the wipers' switch, the dimmer, the mirrors'
button, the end-of-train signalling and the forced resistor fans: fourteen
fields the cab, the AI, the scenery and the tests wrote straight into
physics::Vehicle are private now. The rest of the simulator reads them through
queries named as the fields were (MainCtrlPos(), Radio(), ...) and changes them
through operations (SetMainCtrlPos(), SetRadio(), ...), so every place that
moves a controller past its own stepping (IncMainCtrl()) is named and can be
found; the compiler keeps anything else out. Inside the vehicle they keep
their meaning under camelCase names. The queries return const references, as
the gauges of the cab bind to them.
The .fiz keys are untouched.
No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
modernDimmerPosition indexed dimPositions without a range check in
RaLightsSet(), SetLightDimmings() and the off_from_dimmer value of the
cab's Python state. An empty DimmerList, or a DefaultPos past the end of
a short one, read past the end of the vector; the dimmer commands could
also leave or put the position outside the list.
Reads go through currentDimPosition(), a plain entry (not off, not
dimmed) outside the list. DefaultPos and the position are clamped after
the .fiz is loaded, the increase/decrease commands step through
stepDimmerPosition(), which clamps and does nothing for an empty list,
and headlightsdimenable clamps its position 1.