MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / modifyNumValue

Function modifyNumValue

lib/macro/macro-action-variable.cpp:40–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40static void modifyNumValue(Variable &var, double val, const bool increment)
41{
42 auto current = var.DoubleValue();
43 if (!current.has_value()) {
44 return;
45 }
46
47 if (increment) {
48 var.SetValue(*current + val);
49 } else {
50 var.SetValue(*current - val);
51 }
52}
53
54MacroActionVariable::~MacroActionVariable()
55{

Callers 1

PerformActionMethod · 0.85

Calls 2

DoubleValueMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected