protected void findSourceAsteroid()
        {
            if (this.asteroid != null)
            {
                return;
            }

            List <ModuleAsteroid> asteroids = this.part.vessel.FindPartModulesImplementing <ModuleAsteroid>();

            //No asteroids? We're done.
            if (asteroids.Count == 0)
            {
                ScreenMessages.PostScreenMessage("Please capture an asteroid to process.", 5.0f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            //Only one asteroid? target it and we're done.
            if (asteroids.Count == 1)
            {
                asteroid = asteroids.First <ModuleAsteroid>();
                return;
            }

            //Grab selector if needed.
            if (asteroidSelector == null)
            {
                asteroidSelector = this.part.FindModuleImplementing <WBIAsteroidSelector>();
            }

            //Ask the selector to select an asteroid
            if (asteroidSelector != null)
            {
                this.asteroid = asteroidSelector.SelectAsteroid();
            }
        }
 public override void OnStart(StartState state)
 {
     asteroidSelector = this.part.FindModuleImplementing <WBIAsteroidSelector>();
     if (asteroidSelector != null)
     {
         asteroidSelector.onAsteroidSelected += new AsteroidSelectedEvent(asteroidSelector_onAsteroidSelected);
     }
     base.OnStart(state);
 }