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

Method set

source/game/StarBehaviorState.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void Blackboard::set(NodeParameterType type, String const& key, LuaValue value) {
28 if (value.is<LuaNilType>())
29 m_board.get(type).remove(key);
30 else
31 m_board.get(type).set(key, value);
32
33 for (auto& input : m_input.get(type).maybe(key).value({})) {
34 m_parameters.get(input.first).set(input.second, value);
35 }
36
37 // dumb special case for setting number outputs to vec2 inputs
38 if (type == NodeParameterType::Number) {
39 for (pair<uint64_t, LuaTable>& input : m_vectorNumberInput.maybe(key).value()) {
40 input.second.set(input.first, value);
41 }
42 }
43}
44
45LuaValue Blackboard::get(NodeParameterType type, String const& key) const {
46 return m_board.get(type).maybe(key).value(LuaNil);

Callers 10

BlackboardMethod · 0.45
parametersMethod · 0.45
BehaviorStateMethod · 0.45
runActionMethod · 0.45
runDecoratorMethod · 0.45
runSequenceMethod · 0.45
runSelectorMethod · 0.45
runParallelMethod · 0.45
runDynamicMethod · 0.45
runRandomizeMethod · 0.45

Calls 4

removeMethod · 0.45
getMethod · 0.45
valueMethod · 0.45
maybeMethod · 0.45

Tested by

no test coverage detected