18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 04:47:06 +01:00
Files
maszyna/tests
Hirek b35a6129bc refactor(ai): the orders of the AI are DriverOrder and DriverOrders, not the bits of TOrders
The orders of the AI driver (TOrders) were unscoped bits, summed (an order
carries Change_direction on top of Shunt), masked, and compared as numbers
(order < Obey_train, order >= Shunt).

- vehicle/driverorders.h: enum class DriverOrder (waitForOrders,
  prepareEngine, releaseEngine, changeDirection, connect, disconnect, shunt,
  looseShunt, obeyTrain, bank, jumpToFirstOrder) and DriverOrders, an
  EnumSet of them. A small header, so brakesetting.h names the orders without
  Driver.h.
- the comparisons of the numbers are the sets they meant: the orders from
  shunt up are movingOrders, those from obeyTrain up trainOrders;
  SingleOrder() gives the order to a switch, where a sum of several matches
  no case, as it did
- the texts of the scenery commands (Shunt, Obey_train...) and of the
  translations are unchanged; only the C++ names changed

No change in behaviour: 1144/1144 tests, golden traces exact against staging
62f7a29b.
2026-11-28 13:43:45 +01:00
..