| 33 | static ASContext* local_ctx = NULL; |
| 34 | |
| 35 | static CScriptArray* AS_GetArray(SavedLevel* save_file, const std::string& key) { |
| 36 | asIScriptContext* ctx = local_ctx->ctx; |
| 37 | asIScriptEngine* engine = ctx->GetEngine(); |
| 38 | asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<string>")); |
| 39 | CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0); |
| 40 | |
| 41 | std::vector<std::string> source_arr = save_file->GetArray(key); |
| 42 | |
| 43 | array->Reserve(source_arr.size()); |
| 44 | |
| 45 | std::vector<std::string>::iterator layerit = source_arr.begin(); |
| 46 | |
| 47 | for (; layerit != source_arr.end(); layerit++) { |
| 48 | array->InsertLast((void*)&(*layerit)); |
| 49 | } |
| 50 | |
| 51 | return array; |
| 52 | } |
| 53 | |
| 54 | void AttachSaveFile(ASContext* ctx, SaveFile* save_file) { |
| 55 | local_ctx = ctx; |
nothing calls this directly
no test coverage detected