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

Method netElementsNeedLoad

source/game/StarStatCollection.cpp:164–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void StatCollection::netElementsNeedLoad(bool) {
165 if (m_statModifiersNetState.pullUpdated()) {
166 StatModifierGroupMap allModifiers;
167 for (auto const& p : m_statModifiersNetState)
168 allModifiers.add(p.first, p.second);
169 m_stats.setAllStatModifierGroups(std::move(allModifiers));
170 }
171
172 for (auto const& pair : m_resourceValuesNetStates)
173 m_stats.setResourceValue(pair.first, pair.second.get());
174
175 for (auto& pair : m_resourceLockedNetStates)
176 m_stats.setResourceLocked(pair.first, pair.second.get());
177}
178
179void StatCollection::netElementsNeedStore() {
180 m_statModifiersNetState.setContents(m_stats.allStatModifierGroups());

Callers

nothing calls this directly

Calls 6

setResourceValueMethod · 0.80
pullUpdatedMethod · 0.45
addMethod · 0.45
getMethod · 0.45
setResourceLockedMethod · 0.45

Tested by

no test coverage detected