public void AddSprite(Sprite sprite)
        {
            // Don't add null sprites or sprites that are already present.
            if (null == sprite || _Sprites.Contains(sprite))
                return;

            _Sprites.Add(sprite);
        }
        // Gets called when we hit something
        internal override void Hit(Sprite s2)
        {
            // Do I already have a parent?
            if (null != Parent)
                // Yes!  I have a parent.  So I'm already stuck to something.
                return;

            // Am I hitting a ship?
            if (s2 is Ship)
                // Yes!  Ignore that, since I'll never really fire otherwise.
                return;

            // Otherwise, we hit something that we should stick to.
            // Never time out.
            _TimeOut = DateTime.MaxValue;

            // And stick to whatever we hit.
            Parent = s2;
        }
        protected bool CanBeParent(Sprite value)
        {
            List<Sprite> ancestors = new List<Sprite>();
            Sprite parent = value;
            while (null != parent)
            {
                if (this == parent)
                    return false;
                parent = parent.Parent;
            }

            return true;
        }
        internal bool IsCollidingWith(Sprite s2)
        {
            // A Sprite colliding with itself is ignored.
            if (this == s2)
                return false;

            // If a sprite hits something that doesn't exists, ignore.
            if (s2._Image == null || this._Image == null)
                return false;

            if (this is Missile)
            {
                // Ignore collisions with ships. We are interested in missiles and planets only.
                if ((s2 is AIShip) || (s2 is Ship)) return false;
            }
            else
                return false;

            Vector2F offset = this.Position - s2.Position;

            double my_radius = Math.Sqrt(_Image.Width * _Image.Width + _Image.Height * _Image.Height)/2;
            double s2_radius = Math.Sqrt(s2._Image.Width * s2._Image.Width + s2._Image.Height * s2._Image.Height)/2;
            if (offset.Length > my_radius + s2_radius)
                return false;

            Bitmap b = new Bitmap(_Image.Width, _Image.Height);
            Graphics g = Graphics.FromImage(b);
            Matrix s2_to_world = s2.TransformLocalToWorld;

            Matrix world_to_local = TransformLocalToWorld;
            world_to_local.Invert();

            Matrix s2_to_local = world_to_local;
            s2_to_local.Multiply(s2_to_world);

            g.Transform = s2_to_local;

            Vector2F draw_location = new Vector2F(0,0);
            g.DrawImage(s2._Image, draw_location);

            for (int x = 0; x < b.Width; ++x)
                for (int y = 0; y < b.Height; ++y)
                {
                    Color mine = _Bitmap.GetPixel(x, y);
                    Color theirs = b.GetPixel(x, y);

                    if (mine.A > 0.5 && theirs.A > 0.5)
                        return true;
                }

            return false;
        }
 internal virtual void Hit(Sprite s2)
 {
 }
 public void RemoveSprite(Sprite sprite)
 {
     _Sprites.Remove(sprite);
 }