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

Method Init

engine/Evaluator/express.cpp:2361–2397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2359}
2360
2361void GameState::Init()
2362{
2363 _typeNames.Clear();
2364 NewType("SCALAR", GameScalar, CreateGameDataScalar, DefaultInfoFunctions()->GetTypeName(GameScalar));
2365 NewType("BOOL", GameBool, CreateGameDataBool, DefaultInfoFunctions()->GetTypeName(GameBool));
2366 NewType("ARRAY", GameArray, CreateGameDataArray, DefaultInfoFunctions()->GetTypeName(GameArray));
2367 NewType("STRING", GameString, CreateGameDataString, DefaultInfoFunctions()->GetTypeName(GameString));
2368 NewType("NOTHING", GameNothing, CreateGameDataNothing, DefaultInfoFunctions()->GetTypeName(GameNothing));
2369
2370 NewType("IF", GameIf, CreateGameDataIf, DefaultInfoFunctions()->GetTypeName(GameIf));
2371 NewType("WHILE", GameWhile, CreateGameDataWhile, DefaultInfoFunctions()->GetTypeName(GameWhile));
2372 NewType("FOR", GameFor, CreateGameDataFor, DefaultInfoFunctions()->GetTypeName(GameFor));
2373 NewType("FOR_FROM", GameForFrom, CreateGameDataForFrom, DefaultInfoFunctions()->GetTypeName(GameForFrom));
2374 NewType("FOR_TO", GameForTo, CreateGameDataForTo, DefaultInfoFunctions()->GetTypeName(GameForTo));
2375
2376 _functions.Clear();
2377 int unarySize = 0;
2378 const GameFunction* unaryArray = GetDefaultUnary(&unarySize);
2379 for (int i = 0; i < unarySize; i++)
2380 {
2381 NewFunction(unaryArray[i]);
2382 }
2383 _operators.Clear();
2384 int binarySize = 0;
2385 const GameOperator* binaryArray = GetDefaultBinary(&binarySize);
2386 for (int i = 0; i < binarySize; i++)
2387 {
2388 NewOperator(binaryArray[i]);
2389 }
2390 _nulars.Clear();
2391 int nularSize = 0;
2392 const GameNular* nularArray = GetDefaultNular(&nularSize);
2393 for (int i = 0; i < nularSize; i++)
2394 {
2395 NewNularOp(nularArray[i]);
2396 }
2397}
2398
2399void GameState::Reset()
2400{

Callers 3

LLVMFuzzerInitializeFunction · 0.45
LLVMFuzzerInitializeFunction · 0.45
EnsureInitializedMethod · 0.45

Calls 5

GetDefaultUnaryFunction · 0.85
GetDefaultBinaryFunction · 0.85
GetDefaultNularFunction · 0.85
ClearMethod · 0.45
GetTypeNameMethod · 0.45

Tested by

no test coverage detected