| 1201 | } |
| 1202 | |
| 1203 | EntityHandle EntitySystemHelpersBase::GetSingletonEntity(ExtComponentType type) |
| 1204 | { |
| 1205 | auto& meta = GetComponentMeta(type); |
| 1206 | if (meta.SingleComponentQuery == ecs::UndefinedQuery) { |
| 1207 | WARN("No query defined for singleton %s?", GetComponentName(meta.ComponentIndex)->c_str()); |
| 1208 | return {}; |
| 1209 | } |
| 1210 | |
| 1211 | auto world = GetEntityWorld(); |
| 1212 | auto const& query = world->Queries.Queries[(unsigned)meta.SingleComponentQuery]; |
| 1213 | if (query.EntityStorages.empty()) { |
| 1214 | return {}; |
| 1215 | } |
| 1216 | |
| 1217 | auto const& storage = query.EntityStorages.values()[0]; |
| 1218 | if (storage.Storage->InstanceToPageMap.empty()) { |
| 1219 | return {}; |
| 1220 | } |
| 1221 | |
| 1222 | return storage.Storage->InstanceToPageMap.keys()[0]; |
| 1223 | } |
| 1224 | |
| 1225 | SystemTypeEntry* EntitySystemHelpersBase::GetSystemEntry(ExtSystemType type) |
| 1226 | { |
nothing calls this directly
no test coverage detected