public BlockStatusControl(Program p) { this.p = p; BlockRetriever.GetBlocksOfType(p, out Batteries); BlockRetriever.GetBlocksOfType(p, out OxygenTanks); BlockRetriever.GetBlocksOfType(p, out HydrogenTanks); BlockRetriever.GetBlocksOfType(p, out AirVents); }
public void ConvertEntry() { BlockRetriever.GetBlocksOfType(p, out this.listStub); string oldNamme; foreach (var entry in listStub) { oldNamme = entry.DefinitionDisplayNameText; entry.CustomName = RemoveSubstring(entry.CustomName, oldNamme); } }
public NavLightController(Program p) { this.p = p; BlockRetriever.GetBlocksOfType(p, out lightBlocks, r => r.CustomName.ToLower().Contains(NAVL) || r.CustomName.ToLower().Contains(NAVR)); BlockRetriever.GetBlocksOfType(p, out controlBlocks); foreach (var light in lightBlocks.Where(r => r.CustomName.ToLower().Contains(NAVL))) { light.Color = Color.Red; } foreach (var light in lightBlocks.Where(r => r.CustomName.ToLower().Contains(NAVR))) { light.Color = Color.Green; } }
public BlockRetrieverTests() { this.publisher = new PublisherSocket(); try { var publisherPort = this.publisher.BindRandomPort("tcp://localhost"); this.chainInformationClient = new Mock <IChainInformationClient>(); this.rpc = new Mock <IRpcClientFactory>(); this.rpc .Setup(f => f.CreateChainInformationClientAsync(It.IsAny <CancellationToken>())) .ReturnsAsync(this.chainInformationClient.Object); this.listener = new Mock <IBlockListener>(); this.subject = new BlockRetriever(this.rpc.Object, "tcp://localhost:" + publisherPort); } catch { this.publisher.Dispose(); throw; } }
private void Setup() { this.navLightController = new NavLightController(this); BlockRetriever.GetBlocksOfType(this, out controlBlocks); AutoPilot = new AutoPilotController(this, controlBlocks.First()); }