Example #1
0
    /* #endregion */

    /* #endregion */
    /* ======================================================================================== */

    /* #region ==== U P D A T E  P L A Y E R  S T A T S ======================================= */

    /* #region ---- General Update Player Stat Method ----------------------------------------- */
    public void UpdateStat(PlayerStat stat, int newValue, ValueSign valueSign)
    {
        switch (stat)
        {
        case PlayerStat.ActionPoints:
            updateActionPoints(newValue, valueSign);
            break;
        }
    }
Example #2
0
    /* #endregion */

    /* #region ---- Action Points ------------------------------------------------------------- */
    private void updateActionPoints(int updateValue, ValueSign valueSign)
    {
        if (valueSign == ValueSign.Negative)
        {
            updateValue = -updateValue;
        }

        if (updateValue <= MaxActionPoints)
        {
            CurrentActionPoints += updateValue;
        }
        if (updateValue > MaxActionPoints)
        {
            CurrentActionPoints = MaxActionPoints;
        }
    }