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

Function ASGetSelected

Source/Scripting/angelscript/asfuncs.cpp:2424–2439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2422}
2423
2424CScriptArray* ASGetSelected() {
2425 asIScriptContext* ctx = asGetActiveContext();
2426 asIScriptEngine* engine = ctx->GetEngine();
2427 asITypeInfo* arrayType = engine->GetTypeInfoById(engine->GetTypeIdByDecl("array<int>"));
2428 CScriptArray* array = CScriptArray::Create(arrayType, (asUINT)0);
2429 array->Reserve(the_scenegraph->objects_.size());
2430
2431 const SceneGraph::object_list& objects = the_scenegraph->objects_;
2432 for (auto obj : objects) {
2433 if (obj->Selected()) {
2434 int val = obj->GetID();
2435 array->InsertLast(&val);
2436 }
2437 }
2438 return array;
2439}
2440
2441vec3 ASGetScale(Object* obj) {
2442 return obj->GetScale();

Callers

nothing calls this directly

Calls 9

GetTypeInfoByIdMethod · 0.80
SelectedMethod · 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