using GameData;
using Server.Core;

namespace ObjectModel.User
{
    public class ZiChanLogData : IReference
    {
        public int Id;
        public long ChangeValue;
        public long FinValue;
        public string Tag;
        
        public UserGoldLogType GoldLogType;

        public void Dispose()
        {
            ReferencePool.Recycle(this);
        }
        
        public static ZiChanLogData CreateGold(long changeValue, long finValue, UserGoldLogType goldLogType, string tag)
        {
            ZiChanLogData data = ReferencePool.Fetch<ZiChanLogData>();
            data.Id = ResName.Gold;
            data.ChangeValue = changeValue;
            data.FinValue = finValue;
            data.GoldLogType = goldLogType;
            data.Tag = tag;
            return data;
        }
        
        public static ZiChanLogData Create(int id, long changeValue, long finValue, string tag)
        {
            ZiChanLogData data = ReferencePool.Fetch<ZiChanLogData>();
            data.Id = id;
            data.ChangeValue = changeValue;
            data.FinValue = finValue;
            data.Tag = tag;
            return data;
        }

        public bool IsFromPool { get; set; }
        public long ReferenceId { get; set; }
    }
}