public Program() { Runtime.UpdateFrequency = UpdateFrequency.Update100; solarsAndWind = new PowerSourceCollection <IMyPowerProducer>(GridTerminalSystem, Me, b => !(b is IMyReactor || b is IMyBatteryBlock)); batteries = new BatteryCollection(GridTerminalSystem, Me); reactors = new PowerSourceCollection <IMyReactor>(GridTerminalSystem, Me, b => b.CustomName.Contains("Reactor")); hydrogengines = new PowerSourceCollection <IMyReactor>(GridTerminalSystem, Me, b => !b.CustomName.Contains("Reactor")); GridTerminalSystem.GetBlocksOfType <IMyTextPanel>(displays, b => b.CustomName.Contains(DISPLAY_TAG) && b.CubeGrid == Me.CubeGrid); }
public Program() { Runtime.UpdateFrequency = UpdateFrequency.Update100; solars = new PowerSourceCollection(this, Me, b => b is IMyPowerProducer && !(b is IMyReactor || b is IMyBatteryBlock) && b.BlockDefinition.TypeId.ToString().Contains("Solar")); wind = new PowerSourceCollection(this, Me, b => b is IMyPowerProducer && !(b is IMyReactor || b is IMyBatteryBlock) && b.BlockDefinition.TypeId.ToString().Contains("Wind")); batteries = new BatteryCollection(this, Me); reactors = new PowerSourceCollection(this, Me, b => b is IMyReactor && b.BlockDefinition.TypeId.ToString().Contains("Reactor")); hydrogengines = new PowerSourceCollection(this, Me, b => b is IMyPowerProducer && b.BlockDefinition.TypeId.ToString().Contains("Hydrogen")); GridTerminalSystem.GetBlocksOfType <IMyTextPanel>(displays, b => b.CustomName.Contains(DISPLAY_TAG) && b.CubeGrid == Me.CubeGrid); indicatorSize.X = (screenSize.X - edgePadding * 2) / 2; indicatorSize.Y = lineSize - lineGap; }