MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / NewFunction

Method NewFunction

engine/Evaluator/express.cpp:2227–2242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225 }
2226}
2227void GameState::NewFunction(const GameFunction& f)
2228{
2229 GameFunctions& ft = _functions[f._name];
2230 if (_functions.IsNull(ft))
2231 {
2232 _functions.Add(GameFunctions(f._opName));
2233 }
2234 GameFunctions& functions = _functions[f._name];
2235 GameFunction o = f;
2236 o._name = functions._name;
2237
2238 int n = functions.Size();
2239 functions.Realloc(n + 1);
2240 functions.Resize(n + 1);
2241 functions[n] = o;
2242}
2243void GameState::NewOperator(const GameOperator& op)
2244{
2245 GameOperators& ot = _operators[op._name];

Calls 6

GameFunctionsClass · 0.85
IsNullMethod · 0.45
AddMethod · 0.45
SizeMethod · 0.45
ReallocMethod · 0.45
ResizeMethod · 0.45

Tested by 2

RegisterReentrantOpsFunction · 0.64