MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ASGetObjectIDArray

Function ASGetObjectIDArray

Source/Scripting/angelscript/asfuncs.cpp:2532–2547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2530}
2531
2532CScriptArray* ASGetObjectIDArray() {
2533 asIScriptContext* ctx = asGetActiveContext();
2534 asIScriptEngine* engine = ctx->GetEngine();
2535 asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<int>"));
2536 CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0);
2537 array->Reserve(the_scenegraph->objects_.size());
2538
2539 const SceneGraph::object_list& objects = the_scenegraph->objects_;
2540 for (auto object : objects) {
2541 int val = object->GetID();
2542 if (val != -1) {
2543 array->InsertLast(&val);
2544 }
2545 }
2546 return array;
2547}
2548
2549void ASDeleteObjectID(int val) {
2550 LOGD << "Deleting id: " << val << std::endl;

Callers

nothing calls this directly

Calls 8

GetTypeInfoByIdMethod · 0.80
CreateFunction · 0.50
GetEngineMethod · 0.45
GetTypeIdByDeclMethod · 0.45
ReserveMethod · 0.45
sizeMethod · 0.45
GetIDMethod · 0.45
InsertLastMethod · 0.45

Tested by

no test coverage detected