Rise
The Vieneo Province
Loading...
Searching...
No Matches
RainAir.h
Go to the documentation of this file.
1#pragma once
2
3namespace RainAir
4{
5enum class State { Off, Active, Unavailable };
6
7// These aircraft have no separate pneumatic pressure or engine-idle model. Powered,
8// serviceable engines supply regulated rain air even at zero commanded thrust.
9// SVesselDC::rainAir is authoritative: -1 absent, 0 failed, positive serviceable.
10inline State Evaluate(int equipment, bool selected, bool operating, float power, bool engineAvailable)
11{
12 if (equipment < 0 || !operating) return State::Off;
13 // A known equipment failure remains INOP even when the R switch is off.
14 if (equipment == 0) return State::Unavailable;
15 if (!selected) return State::Off;
16 return power > .5f && engineAvailable ? State::Active : State::Unavailable;
17}
18inline float Flow(State state) { return state == State::Active ? 1.f : 0.f; }
19
20// Regulated windshield bleed: a small loss of delivered thrust, separate from
21// anti-ice's existing rated-thrust debit. 0.5% is a game tuning approximation;
22// see docs/RainAir.md. Off/unavailable equipment consumes no bleed air.
23inline float ThrustMultiplier(State state)
24{
25 return 1.f - .005f * Flow(state);
26}
27}
State Evaluate(int equipment, bool selected, bool operating, float power, bool engineAvailable)
Definition RainAir.h:10
float Flow(State state)
Definition RainAir.h:18
float ThrustMultiplier(State state)
Definition RainAir.h:23