18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 03:37:09 +01:00

refactor(physics): six more of what the rest only reads are private, under names of their own

The mass of the empty vehicle, the braking force, the outcome of a derailment,
the departure signal, the traction mode of a dual-mode vehicle and the moment
of the motors are private to physics::Vehicle like the 53 before them, read
through Mass(), Fb(), Derailed(), DepartureSignal(), TractionMode() and Mm().
Inside the class they are emptyMass, brakingForce, derailOutcome,
departureSignalOn, tractionModeSetting and motorMoment, as the plain camelCase
names were taken by locals there.

No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
2026-11-29 13:23:53 +01:00
parent 5879c228dc
commit ef8a1fdbfd
41 changed files with 167 additions and 160 deletions
+7 -7
View File
@@ -851,8 +851,8 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const Parameter) {
return std::abs(mvControlling->Fb) <= Parameter; },
static_cast<float>(std::min( 0.0, 0.95 * std::abs( mvControlling->Fb ) )) ); // keep hint until 5% decrease
return std::abs(mvControlling->Fb()) <= Parameter; },
static_cast<float>(std::min( 0.0, 0.95 * std::abs( mvControlling->Fb() ) )) ); // keep hint until 5% decrease
break;
}
case driver_hint::brakingforceincrease: {
@@ -867,12 +867,12 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const Parameter) {
return std::abs(mvControlling->Fb) > Parameter || is_equal(occupied->brakes.HandlePositionSmooth(), occupied->brakes.driverValve->GetPos(bh_EB), 0.2); },
return std::abs(mvControlling->Fb()) > Parameter || is_equal(occupied->brakes.HandlePositionSmooth(), occupied->brakes.driverValve->GetPos(bh_EB), 0.2); },
static_cast<float>(std::max(
0.0,
std::max(
std::abs( mvControlling->Fb ) * 1.05,
std::abs( mvControlling->Fb ) + 5.0 ) )) );
std::abs( mvControlling->Fb() ) * 1.05,
std::abs( mvControlling->Fb() ) + 5.0 ) )) );
break;
}
case driver_hint::brakingforcesetzero: { // releases both train and independent brake
@@ -1052,7 +1052,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const /*Parameter*/) {
return occupied->Doors.has_warning == false || occupied->Doors.has_autowarning == true || occupied->DepartureSignal == true || occupied->Vel > 5.0; } );
return occupied->Doors.has_warning == false || occupied->Doors.has_autowarning == true || occupied->DepartureSignal() == true || occupied->Vel > 5.0; } );
break;
}
case driver_hint::departuresignaloff: {
@@ -1063,7 +1063,7 @@ TController::cue_action( driver_hint const Action, float const Actionparameter )
hint(
Action,
[this](float const /*Parameter*/) {
return occupied->Doors.has_warning == false || occupied->Doors.has_autowarning == true || occupied->DepartureSignal == false; } );
return occupied->Doors.has_warning == false || occupied->Doors.has_autowarning == true || occupied->DepartureSignal() == false; } );
break;
}
// consist doors