MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addStat

Method addStat

source/game/StarStatSet.cpp:6–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace Star {
5
6void StatSet::addStat(String statName, float baseValue) {
7 if (!m_baseStats.insert(std::move(statName), baseValue).second)
8 throw StatusException::format("Added duplicate stat named '{}' in StatSet", statName);
9 update(0.0f);
10}
11
12void StatSet::removeStat(String const& statName) {
13 if (!m_baseStats.remove(statName))

Callers 2

StatCollectionMethod · 0.80
TESTFunction · 0.80

Calls 2

formatFunction · 0.50
insertMethod · 0.45

Tested by 1

TESTFunction · 0.64