Пример #1
0
 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;
     myRemote  = null;
 }
Пример #2
0
        public RemoteControl(IMyCubeBlock block)
            : base(block)
        {
            myLogger = new Logger("RemoteControl", () => CubeBlock.CubeGrid.DisplayName);
            myRemote = CubeBlock as Ingame.IMyRemoteControl;
            registry.Add(CubeBlock, this);

            //log("init as remote: " + CubeBlock.BlockDefinition.SubtypeName, "Init()", Logger.severity.TRACE);

            // for my German friends...
            if (!myRemote.DisplayNameText.Contains('[') && !myRemote.DisplayNameText.Contains(']'))
            {
                myRemote.SetCustomName(myRemote.DisplayNameText + " []");
            }
        }