MCPcopy Create free account
hub / github.com/DFHack/dfhack / is_instance

Function is_instance

library/include/DataDefs.h:460–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458 static const virtual_identity *find(std::string_view name);
459
460 bool is_instance(virtual_ptr instance_ptr) const {
461 if (!instance_ptr) return false;
462 if (vtable_ptr()) {
463 void *vtable = get_vtable(instance_ptr);
464 if (vtable == vtable_ptr()) return true;
465 if (!hasChildren()) return false;
466 }
467 return is_subclass(get(instance_ptr));
468 }
469
470 bool is_direct_instance(virtual_ptr instance_ptr) const {
471 if (!instance_ptr) return false;

Callers 7

getFocusStringsMethod · 0.85
getDFViewscreenMethod · 0.85
showMethod · 0.85
dismissMethod · 0.85
try_castMethod · 0.85
logicMethod · 0.85

Calls 4

vtable_ptrFunction · 0.85
get_vtableFunction · 0.85
hasChildrenFunction · 0.85
getFunction · 0.70

Tested by

no test coverage detected