using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ECOT.Engine
{
    /// <summary>
    /// 
    /// </summary>
    public interface IDrawable
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="position"></param>
        /// <param name="layer"></param>
        /// <param name="rotation"></param>
        /// <param name="scaling"></param>
        /// <param name="color"></param>
        void Draw(Vector2 position, float layer, float rotation, float scaling, Color color);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="transform"></param>
        /// <param name="color"></param>
        void Draw(Matrix transform, Color color);
    }

    /// <summary>
    /// 
    /// </summary>
    public interface IUpdatable
    {
        bool Enabled { get; set; }

        /// <summary>
        /// 
        /// </summary>
        void Update(GameTime gameTime);
    }

    /// <summary>
    /// 
    /// </summary>
    public interface IRenderable
    {
        bool Enabled { get; set; }

        void Render();
    }

    public abstract class IsDisposable : IDisposable
    {
        private bool disposed = false;

        public void Dispose()
        {
            this.Dispose(true);
        }

        public virtual void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    this.DisposeManaged();
                }
                this.DisposeUnmanaged();
            }
            this.disposed = true;
        }

        ~IsDisposable()
        {
            if (!this.disposed)
                this.Dispose(false);
        }

        public abstract void DisposeManaged();
        public abstract void DisposeUnmanaged();
    }
}
