using Microsoft.Xna.Framework;
using MonoGame.FourEngine.Interfaces;
using System;

namespace MonoGame.FourEngine.Entities
{
    public class ComponentWrapper<T> : Entity, IHaveSizeAndPosition
        where T : Component
    {
        public T Component { get; }

        public Point Position
        {
            get => Component.Position;
            set => Component.Position = value;
        }

        public int Width { get; set; }
        public int Height { get; set; }

        public ComponentWrapper(T component = null)
        {
            if (component == null)
                component = Activator.CreateInstance<T>();
            Components.Add(Component = component);
        }
    }

    public class ComponentWrapper : ComponentWrapper<Component>
    {
    }
}