Exemplo n.º 1
0
		public LaserAntenna(IMyCubeBlock block)
			: base(block)
		{
			myLaserAntenna = CubeBlock as Ingame.IMyLaserAntenna;
			myLogger = new Logger("LaserAntenna", () => CubeBlock.CubeGrid.DisplayName);
			Registrar.Add(block, this);
		}
Exemplo n.º 2
0
        public LaserAntenna(IMyCubeBlock block)
            : base(block)
        {
            myLaserAntenna = CubeBlock as Ingame.IMyLaserAntenna;
            myLogger       = new Logger("LaserAntenna", () => CubeBlock.CubeGrid.DisplayName);
            value_registry.Add(this);

            //log("init as antenna: " + CubeBlock.BlockDefinition.SubtypeName, "Init()", Logger.severity.TRACE);
            //EnforcedUpdate = MyEntityUpdateEnum.EACH_100TH_FRAME;
        }
Exemplo n.º 3
0
 protected override void Close(IMyEntity entity)
 {
     try
     {
         if (CubeBlock != null)
         {
             value_registry.Remove(this);
         }
     }
     catch (Exception e)
     { myLogger.log("exception on removing from registry: " + e, "Close()", Logger.severity.WARNING); }
     CubeBlock      = null;
     myLaserAntenna = null;
     myLastSeen     = null;
     myMessages     = null;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates the laser component from a laser antenna block.
 /// </summary>
 /// <param name="laser">The block to create the laser component for.</param>
 public ComponentLaser(Ingame.IMyLaserAntenna laser)
 {
     this.m_logger = new Logger(GetType().Name, laser);
     this.m_laser = laser;
 }