// used for spending XP in the home base
 public bool SpendXP(int spendingAmount)
 {
     if (spendingAmount > finalXP)
     {
         return(false);
     }
     finalXP -= spendingAmount;
     OnXPChanged?.Invoke(-spendingAmount);
     return(true);
 }
    public bool BuyWithTemp(int cost)
    {
        if (CanBuyWithTemp(cost))
        {
            tempXP -= cost;
            if (tempXP < 0)
            {
                finalXP += tempXP;
                tempXP   = 0;
            }
            OnXPChanged?.Invoke(-cost);

            return(true);
        }

        return(false);
    }
 // used for gaining XP in the game
 public void GainXP(int xpAmount)
 {
     tempXP += xpAmount;
     OnXPChanged?.Invoke(xpAmount);
 }