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

Method setValue

source/game/StarStatSet.cpp:293–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293float StatSet::Resource::setValue(float v) {
294 if (maxValue)
295 value = clamp(v, 0.0f, *maxValue);
296 else
297 value = Star::max(v, 0.0f);
298 return value;
299}
300
301StatSet::Resource const& StatSet::getResource(String const& resourceName) const {
302 if (auto r = m_resources.ptr(resourceName))

Callers 11

setResourceValueMethod · 0.45
modifyResourceValueMethod · 0.45
giveResourceValueMethod · 0.45
setResourcePercentageMethod · 0.45
updateMethod · 0.45
consumeResourceValueMethod · 0.45
renderObjectPreviewsMethod · 0.45
lightSourcesMethod · 0.45
lightSourcesMethod · 0.45
beamDrawablesMethod · 0.45

Calls 1

clampFunction · 0.85

Tested by

no test coverage detected