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

Function AS_GetContainers

Source/GUI/IMUI/imui_script.cpp:131–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131static CScriptArray* AS_GetContainers(IMDivider* element) {
132 asIScriptContext* ctx = asGetActiveContext();
133 asIScriptEngine* engine = ctx->GetEngine();
134 asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<IMContainer@>"));
135 CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0);
136
137 unsigned int count = element->getContainerCount();
138 array->Reserve(count);
139
140 for (unsigned i = 0; i < count; i++) {
141 IMContainer* container = element->getContainerAt(i);
142 container->Release();
143 array->InsertLast((void*)&container);
144 }
145
146 return array;
147}
148
149template <class T>
150void registerASIMElement(ASContext* ctx, std::string const& className) {

Callers

nothing calls this directly

Calls 9

GetTypeInfoByIdMethod · 0.80
getContainerCountMethod · 0.80
getContainerAtMethod · 0.80
CreateFunction · 0.50
GetEngineMethod · 0.45
GetTypeIdByDeclMethod · 0.45
ReserveMethod · 0.45
ReleaseMethod · 0.45
InsertLastMethod · 0.45

Tested by

no test coverage detected