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

Function ASGetCampaigns

Source/Scripting/angelscript/asfuncs.cpp:7068–7083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7066}
7067
7068static CScriptArray* ASGetCampaigns() {
7069 asIScriptContext* ctx = asGetActiveContext();
7070 asIScriptEngine* engine = ctx->GetEngine();
7071 asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<Campaign>"));
7072 CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0);
7073
7074 std::vector<ModInstance::Campaign> campaigns = ModLoading::Instance().GetCampaigns();
7075
7076 array->Reserve(campaigns.size());
7077
7078 for (auto& campaign : campaigns) {
7079 array->InsertLast((void*)&campaign);
7080 }
7081
7082 return array;
7083}
7084
7085static void ASLevelConstructor(void* m) {
7086 new (m) ModInstance::Level();

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected