using System;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class EnemyDataLoader : ILoader<EnemyData>
{
    public EnemyGroupData group;
    public List<EnemyData> GetList()
    {
        return group.enemies;
    }
}
[Serializable]
public class EnemyGroupData
{ 
    public string name;
    public string id; 
    public List<EnemyData> enemies; // EnemyData 리스트를 포함
}
[Serializable]
public class EnemyData: ISerializationCallbackReceiver
{
   
    public string name;
    public string id;
    public string type;
    
    // public Status_Enemy status;
    public Data_Status_Enemy status;
    
    
    [NonSerialized] public Define.EnemyType E_Type;
    public void OnBeforeSerialize()
    {
        // 객체를 JSON에 저장할떄 사용할 부분
    }

    public void OnAfterDeserialize()
    {
        if (System.Enum.TryParse<Define.EnemyType>(this.type, true, out Define.EnemyType parsedType))
            this.E_Type = parsedType;
        else
            this.E_Type = Define.EnemyType.Unknown;
    }
}




