MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / VariableOperationHandler

Method VariableOperationHandler

src/Ext/Script/Body.cpp:1011–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009
1010template<bool IsGlobal, class _Pr>
1011void ScriptExt::VariableOperationHandler(TeamClass* pTeam, int nVariable, int Number)
1012{
1013 auto itr = ScenarioExt::Global()->Variables[IsGlobal].find(nVariable);
1014
1015 if (itr != ScenarioExt::Global()->Variables[IsGlobal].end())
1016 {
1017 itr->second.Value = _Pr()(itr->second.Value, Number);
1018 if (IsGlobal)
1019 TagClass::NotifyGlobalChanged(nVariable);
1020 else
1021 TagClass::NotifyLocalChanged(nVariable);
1022 }
1023
1024 pTeam->StepCompleted = true;
1025}
1026
1027template<bool IsSrcGlobal, bool IsGlobal, class _Pr>
1028void ScriptExt::VariableBinaryOperationHandler(TeamClass* pTeam, int nVariable, int nVarToOperate)

Callers

nothing calls this directly

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected