| 129 | } |
| 130 | |
| 131 | static 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 | |
| 149 | template <class T> |
| 150 | void registerASIMElement(ASContext* ctx, std::string const& className) { |
nothing calls this directly
no test coverage detected