Esempio n. 1
0
    private void InternalUpdateBoolStat(UserStatBool i_Stat, bool i_Value, BoolStatUpdateFunction i_UpdateFunction)
    {
        switch (i_UpdateFunction)
        {
        case BoolStatUpdateFunction.Add:
            i_Stat.Add(i_Value);
            break;

        case BoolStatUpdateFunction.Multiply:
            i_Stat.Multiply(i_Value);
            break;

        case BoolStatUpdateFunction.Set:
            i_Stat.Set(i_Value);
            break;
        }
    }
Esempio n. 2
0
 public void UpdateBoolStat(int i_StatId, bool i_Value, BoolStatUpdateFunction i_UpdateFunction)
 {
     for (int userStatIndex = 0; userStatIndex < m_UserStats.Count; ++userStatIndex)
     {
         UserStat userStat = m_UserStats[userStatIndex];
         if (userStat != null)
         {
             int statId = userStat.hashId;
             if (statId == i_StatId)
             {
                 if (userStat.type == UserStatType.Bool)
                 {
                     InternalUpdateBoolStat((UserStatBool)userStat, i_Value, i_UpdateFunction);
                     break;
                 }
             }
         }
     }
 }
 public void UpdateBoolStat(int i_StatId, bool i_Value, BoolStatUpdateFunction i_UpdateFunction)
 {
     m_UserStatsManager.UpdateBoolStat(i_StatId, i_Value, i_UpdateFunction);
 }
    public void UpdateBoolStat(string i_StatId, bool i_Value, BoolStatUpdateFunction i_UpdateFunction)
    {
        int hash = StringUtils.GetHashCode(i_StatId);

        UpdateBoolStat(hash, i_Value, i_UpdateFunction);
    }