using Fantasy;
using Fantasy.Entitas.Interface;

namespace NB.Game;

public class PlayerBasicCacheDestroySystem : DestroySystem<PlayerBasicCache>
{
    protected override void Destroy(PlayerBasicCache self)
    {
        self.Country = string.Empty;
        self.NickName = string.Empty;
        self.Head = string.Empty;
        self.Level = 0;
        self.Vip = 0;
        self.ExpirationTime = 0;
    }
}

public static class PlayerBasicCacheSystem
{

    public static RoleSimpleInfo ToInfo(this PlayerBasicCache player)
    {
        var ret = new RoleSimpleInfo();
        ret.NickName = player.NickName;
        ret.Country = player.Country;
        ret.Head = player.Head;
        ret.Level = player.Level;
        ret.Vip = player.Vip;
        ret.RoleId = player.Id;
        return ret;
    }
}