using System;
using UnityEngine;

namespace FL.Battle
{
    public abstract class Entity : IEntity, IDisposable
    {
        public int TableId { get; private set; }
        public int EntityId { get; private set; }
        public EntityAttributes Attr { get; private set; }
        public Vector3 TargetPosition { get; set; }

        public EEntityState State { get; set; }
        public void Init(int tableId, int entityId, EntityAttributes  attr)
        {
            TableId = tableId;
            EntityId = entityId;
            Attr = attr;
            State = EEntityState.Idle;
        }

        void IDisposable.Dispose()
        {
            OnDispose();
        }

        public abstract EEntityType EntityType { get; }
        protected virtual void OnDispose()
        {
        }

    }
}
