diff --git a/AGENTS.md b/AGENTS.md index 533d09efa..8b7f97f8d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -118,6 +118,18 @@ couplers, collisions, derailment) and `vehicle/` (the vehicle in the scenery, th - The commands between the vehicles are `VehicleCommand` (`physics/vehiclecommand.h`); their text names only matter where a command comes as text. - What depends on the kind of drive (`EngineType`) goes into its class in `physics/components/drive.*`, not into a new `switch`. +- The parts of `physics::Vehicle` are components, as `physics/components/maincircuit.h`, `lowvoltage.h`, `pantographs.h` and + `airsupply.h` show: what the `.fiz` defines is in their public `config`, written only by the parser and the setup of the vehicle; + their state is private, read through queries and changed through operations named after what happens (`Close()`, + `ResetGround()`, `Switch()`). The logic that concerns only a part is its own (`Update()` of the converter, of the compressor, of + the air of the pantographs), and the vehicle hands it what it needs as plain values (`ConverterSupply`, `CompressorInputs`) rather + than a `physics::Vehicle &`. The vehicle decides when a part acts and follows up what a step of it reports. A test that sets a + state directly uses the `...ForTest()` operation of the part, never a back door in the game's code. A new part follows the same + pattern, and a part being worked on moves to it. +- What concerns a consist rather than a vehicle works on the vehicles of the consist given to it in their order + (`physics::ConsistBrakeBlending`), not on `TDynamicObject`, so that it can be tested without the scenery. +- The renderer and the rest of the simulator outside `physics/` and `vehicle/` read a vehicle through `TDynamicObject` (its + dimensions, speed, active cab, lights), not through `physics/vehicle.h`. ## Renderers: the move to OpenGL 4.6 and Vulkan