public void Should_format_int_statistics(int value, string expected) { var statistic = new IntStatistic(() => value); statistic.Refresh(); Assert.AreEqual(expected, statistic.Formatted); }
/// <summary> /// Increase the value of the specified integer statistic by the specified amount. /// </summary> public void Increment(IntStatistic stat, int amount = 1) { if (!m_intStats.ContainsKey(stat)) { m_intStats[stat] = amount; } else { m_intStats[stat] += amount; } }
public void TakeDamage(float damage) { damage -= Armor; damage = Mathf.Clamp(damage, 0, Int32.MaxValue); CurrentHealth -= damage; if (CurrentHealth <= 0) { Die(); } }
/// <summary> /// Get the value of the supplied statistic. /// </summary> public int Get(IntStatistic stat) { return(m_intStats.ContainsKey(stat) ? m_intStats[stat] : 0); }