using System;
using System.Collections.Generic;
using System.Linq;
using EFT;
using EFT.Counters;
using UnityEngine;

namespace EscapeFromTarkovCheat.Features
{
    public static class ExperienceManager
    {
        public static long current = 0;
        public static void SetExperience(Player player, float experience)
        {
            if (player != null && player.Profile != null)
            {
                current = Get(player);
                player.Profile.EftStats.SessionCounters.SetLong((long)experience, CounterTag.Exp);
                current = (long)experience;
                Debug.Log(string.Format("Experience set to {0}", experience));
            }
        }
        public static void AddExperience(Player player, float experience)
        {
            if (player != null && player.Profile != null)
            {
                current = Get(player);
                SetExperience(player, current + experience);
            }
        }
        public static int Get(Player player)
        {
            if (player != null && player.Profile != null)
            {
                return player.Profile.EftStats.SessionCounters.GetInt(CounterTag.Exp);
            }

            return 0;
        }
    }
}