Ejemplo n.º 1
0
        /// <summary>
        /// Creates an obstruction list from stators and rotors.
        /// </summary>
        private void MyMotorTurret_OnStatorChange(IMyMotorStator statorEl, IMyMotorStator statorAz)
        {
            myLogger.debugLog("entered MyMotorTurret_OnStatorChange()", "MyMotorTurret_OnStatorChange()");

            List<IMyEntity> ignore = new List<IMyEntity>();
            if (statorEl != null)
            {
                myLogger.debugLog("added statorEl.CubeGrid: " + statorEl.CubeGrid.getBestName(), "MyMotorTurret_OnStatorChange()");
                ignore.Add(statorEl.CubeGrid);
            }
            if (statorAz != null)
            {
                myLogger.debugLog("added statorAz: " + statorAz.getBestName(), "MyMotorTurret_OnStatorChange()");
                ignore.Add(statorAz);

                IMyCubeBlock statorAzRotor;
                if (StatorRotor.TryGetRotor(statorAz, out statorAzRotor))
                {
                    myLogger.debugLog("added statorAzRotor: " + statorAzRotor.getBestName(), "MyMotorTurret_OnStatorChange()");
                    ignore.Add(statorAzRotor);
                }
            }
            ObstructionIgnore = ignore;
        }