using FlatRedBall;
using FlatRedBall.Math.Geometry;

namespace FlatRedBall_XNA
{
    public class Lightning : PositionedObject
    {
        #region Fields

        private Sprite sprite;
        private Circle shape;

        #endregion

        #region Properties

        #region XML Docs
        /// <summary>
        /// The collision of the object - can be used to perform collisions between entities.
        /// </summary>
        #endregion
        public Circle Collision
        {
            get { return shape; }
        }
        public Wizard owner { get; set; }
        #endregion

        #region Methods

        #region XML Docs
        /// <summary>
        /// Creates the Entitity and adds it to the SpriteManager.  Also adds
        /// its components to their respective managers.
        /// </summary>
        /// <remarks>
        /// Be sure to call Destroy when done with this object so it cleans itself up.
        /// </remarks>
        /// <param name="contentManagerName">The content manager name to use for loading data.</param>
        #endregion
        public Lightning(string contentManagerName)
        {
            SpriteManager.AddPositionedObject(this);
            sprite = SpriteManager.AddSprite(("lightning.gif"), contentManagerName);
            sprite.AttachTo(this, false);
            shape = ShapeManager.AddCircle();
            shape.AttachTo(this, false);
            shape.Visible = false;
        }

        #region XML Docs
        /// <summary>
        /// Contains every-frame logic which needs to be manually called by the game layer.
        /// Usually this method is called by the current Screen's Activity method.
        /// </summary>
        #endregion
        public void Activity()
        {
            // This code should do things like set Animations, respond to input, and so on.
            // 
        }

        #region XML Docs
        /// <summary>
        /// Removes this and all of its components from their respective managers.
        /// </summary>
        #endregion
        public void Destroy()
        {
            SpriteManager.RemovePositionedObject(this);
            SpriteManager.RemoveSprite(sprite);
            ShapeManager.Remove(shape);
        }

        #endregion
    }
}
