Пример #1
0
    /*
     * Removes a stat if the requested stat has any statpoints invested
     * @Param StatType - The stat type the player wants to decrease
     */
    public void RemoveStat(StatType stat)
    {
        switch (stat)
        {
        case StatType.sta:  if (GetStatPoints(StatType.sta) > 0)
            {
                sta.RemoveStat(); ++unallocatedPts;
            }
            break;

        case StatType.str:  if (GetStatPoints(StatType.str) > 0)
            {
                str.RemoveStat(); ++unallocatedPts;
            }
            break;

        case StatType.dex:  if (GetStatPoints(StatType.dex) > 0)
            {
                dex.RemoveStat(); ++unallocatedPts;
            }
            break;

        case StatType.def:  if (GetStatPoints(StatType.def) > 0)
            {
                def.RemoveStat(); ++unallocatedPts;
            }
            break;
        }
    }