Exemplo n.º 1
0
        void PrimePilot_Drop(KeeperTime ktime, Vector position, double heading, double speed)
        {
            //////////////////////////////////
            // Make a new sprite.
            PilotSprite sprite = new PrimePilotSprite(ktime, (IPilotControllerRequest)this, position, heading, speed);

            AddSprite(ktime, sprite); // Add a sprite to the controller.
        }
Exemplo n.º 2
0
        /// <summary>
        /// Callback handler for when the controller adds a sprited.
        /// </summary>
        protected void Controller_AddedSpriteHandler(object sender, AddSpriteArgs e)
        {
            if (e.sprite is AresMissileSprite)
            {
                AresMissileSprite sprite = e.sprite as AresMissileSprite;
                // Make a new actor.
                AresMissileActor actor = new AresMissileActor(_view_translator, sprite);
                actor.Moved   += Actor_MovedHandler;
                actor.Removed += Actor_RemovedHandler;

                _bogey_actors.Add(actor);                       // Add the actor to the list of bogeys the stage is tracking.

                RadarTargetInsertionCanvas.Children.Add(actor); // Add the actor to the stage.
                actor.Visibility = Visibility.Visible;          // Make the actor visible in the stage.
            }
            else if (e.sprite is BasicBogeySprite)
            {
                BasicBogeySprite sprite = e.sprite as BasicBogeySprite;
                // Make a new actor.
                BasicBogeyActor actor = new BasicBogeyActor(_view_translator, sprite);
                actor.Moved   += Actor_MovedHandler;
                actor.Removed += Actor_RemovedHandler;

                _bogey_actors.Add(actor);                       // Add the actor to the list of bogeys the stage is tracking.

                RadarTargetInsertionCanvas.Children.Add(actor); // Add the actor to the stage.
                actor.Visibility = Visibility.Visible;          // Make the actor visible in the stage.
            }
            else if (e.sprite is PrimePilotSprite)
            {
                PrimePilotSprite sprite = e.sprite as PrimePilotSprite;
                _prime_pilot_sprite = sprite;

                _prime_pilot_sprite.DebugCommandsOn = true; // Turn on extended debug commands.

                // Attach observer/callbacks we need from sprite.
                sprite.Moved   += new MovedHandler(PrimePilotSprite_MovedHandler);
                sprite.Removed += new RemoveHandler(PrimePilotSprite_RemovedHandler);
            }
        }
Exemplo n.º 3
0
 protected virtual void PrimePilotSprite_RemovedHandler(object sender)
 {
     _prime_pilot_sprite = null;                                    // @@@@@@@@@@
     RadarSweepContainer.Children.Remove(RadarSweepBackingEllipse); // @@@@ Havent tried this yet.
 }