public AirPlane(String path) { plane = new PlaneGeneral(); n_fuselage = 0; fuslage = new Fuselage[7, 2]; n_wing = 0; wing = new Wing[1]; n_htail = 0; htail = new Wing[1]; n_vtail = 0; vtail = new Wing[1]; n_canard = 0; canard = new Wing[1]; n_fin = 0; fin = new Wing[5]; n_aileron = 0; aileron = new ControlPlane[1, 2]; n_elevator = 0; elevator = new ControlPlane[1, 2]; n_rudder = 0; rudder = new ControlPlane[1, 2]; n_l_flap = 0; l_flap = new ControlPlane[1, 2]; n_t_flap = 0; t_flap = new ControlPlane[1, 2]; n_canard_elevator = 0; canard_elevator = new ControlPlane[1, 2]; n_powerPlant = 0; powerPlant = new PowerPlant[4]; n_LandingGear = 0; landing_gear = new LandingGear[3, 2]; airbrake = new AirBrake(); interference = new Interference(); pilot = new Pilot(); force = new Vector3D(); torque = new Vector3D(); a_force = new Vector3D(); a_torque = new Vector3D(); f_force = new Vector3D(); f_torque = new Vector3D(); n_force = new Vector3D(); n_torque = new Vector3D(); t_force = new Vector3D(); t_torque = new Vector3D(); flag_landing_gear = 1; flag_land = 1; crash_point = -1; MakeObject(); AirPlaneFile apsf = new AirPlaneFile(this, path); Init(); }
private HeadsUpDisplayBridge(UnityModManager.ModEntry hudMod) { void RegisterPull(string label, Provider provider, Formatter formatter, IComparable?order = null) { hudMod.Invoke( "DvMod.HeadsUpDisplay.Registry.RegisterPull", out var _, new object?[] { label, provider, formatter, order }, RegisterPullArgumentTypes); } void RegisterPush(out Pusher pusher, string label, Formatter formatter, IComparable?order = null) { hudMod.Invoke( "DvMod.HeadsUpDisplay.Registry.RegisterPush", out var temp, new object?[] { label, formatter, order }, RegisterPushArgumentTypes); pusher = (Pusher)temp; } RegisterPull( "Train brake position", car => { if (!CarTypes.IsLocomotive(car.carType)) { return(null); } return(AirBrake.IsSelfLap(car.carType) ? car.brakeSystem.trainBrakePosition : Components.BrakeValve6ET.Mode(car.brakeSystem)); }, v => { return(v <= 1 ? v.ToString("P0") : v == 2 ? "Running" : v == 3 ? "Lap" : v == 4 ? "Service" : "Emergency"); }); RegisterPull( "Triple valve mode", car => CarTypes.IsAnyLocomotiveOrTender(car.carType) ? null : (float?)(int)ExtraBrakeState.Instance(car.brakeSystem).tripleValveMode.Abbrev(), v => Components.TripleValveModeExtensions.FromAbbrev((char)v)); RegisterPush( out auxReservoirPressurePusher, "Aux reservoir", v => $"{v:F2} bar"); RegisterPush( out brakeCylinderPressurePusher, "Brake cylinder", v => $"{v:F2} bar"); RegisterPush( out equalizingReservoirPressurePusher, "Equalizing reservoir", v => $"{v:F2} bar"); }