public bool Load(FileSystem fileSystem) { Parallel.For(0, PMaxIndex, (i) => { Controls[i] = new InputControl() { Command = Translations.Command.PowerAnyNotch, Option = i }; Controls[PMaxIndex + i] = new InputControl() { Command = Translations.Command.BrakeAnyNotch, Option = i }; }); Controls[RevBIndex] = new InputControl() { Command = Translations.Command.ReverserAnyPostion, Option = -1 }; Controls[RevNIndex] = new InputControl() { Command = Translations.Command.ReverserAnyPostion, Option = 0 }; Controls[RevFIndex] = new InputControl() { Command = Translations.Command.ReverserAnyPostion, Option = 1 }; Controls[EBIndex] = new InputControl() { Command = Translations.Command.BrakeEmergency }; Parallel.For(0, CtrlInput.KeyArrSizeMax, (i) => { Controls[(PMaxIndex * 2) + 100 + i] = new InputControl() { Command = (Translations.Command)i }; }); try { StaticSMemLib.Begin(false, true); return(true); } catch (Exception e) { MessageBox.Show("BIDSSMemLib Loading Failed\n" + e.Message, Assembly.GetExecutingAssembly().FullName); return(false); } }
public static void Load() { #if DEBUG MessageBox.Show("BIDSSMemLib Debug Build"); #endif StaticSMemLib.Begin(false, true); BSMD.IsEnabled = true; BSMD.VersionNum = StaticSMemLib.VersionNumInt; StaticSMemLib.Write(in BSMD); if (!Equals(BSMD, StaticSMemLib.ReadBSMD())) { MessageBox.Show("BIDSSMemLib DataWriting Failed"); } BVE_CC ??= new BVEConductorChecker(); BVE_CC.ConductorActioned += BVE_CC_ConductorActioned; }