public ProgrammableBlock(IMyCubeBlock block) : base(block) { myLogger = new Logger("Programmable block", () => CubeBlock.CubeGrid.DisplayName); myProgBlock = CubeBlock as Ingame.IMyProgrammableBlock; Registrar.Add(CubeBlock, this); }
public ProgrammableBlock(IMyCubeBlock block) : base(block) { myLogger = new Logger("Programmable block", () => CubeBlock.CubeGrid.DisplayName); myProgBlock = CubeBlock as Ingame.IMyProgrammableBlock; registry.Add(CubeBlock, this); }
protected override void Close(IMyEntity entity) { try { if (CubeBlock != null && registry.ContainsKey(CubeBlock)) { registry.Remove(CubeBlock); } } catch (Exception e) { myLogger.log("exception on removing from registry: " + e, "Close()", Logger.severity.WARNING); } CubeBlock = null; myProgBlock = null; }
public ProgrammableBlock(IMyCubeBlock block) : base(block) { m_logger = new Logger(GetType().Name, block); m_progBlock = block as Ingame.IMyProgrammableBlock; m_networkClient = new RelayClient(block, HandleMessage); byte index = 0; m_handleDetectedTerminal_ev = new EntityValue<bool>(block, index++, UpdateVisual); m_blockCountList_ev = new EntityStringBuilder(block, index++, () => { UpdateVisual(); m_blockCountList_btl = new BlockTypeList(m_blockCountList_sb.ToString().LowerRemoveWhitespace().Split(',')); }); Registrar.Add(block, this); }