Make EntitiesIterator available
This commit is contained in:
parent
6779af105e
commit
a0d3f443f7
|
|
@ -33,6 +33,13 @@ extension Nexus {
|
||||||
componentIdsByEntity.keys.count
|
componentIdsByEntity.keys.count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates an iterator over all entities in the nexus.
|
||||||
|
///
|
||||||
|
/// Entity order is not guaranteed to stay the same over iterations.
|
||||||
|
public func makeEntitiesIterator() -> EntitiesIterator {
|
||||||
|
EntitiesIterator(nexus: self)
|
||||||
|
}
|
||||||
|
|
||||||
public func exists(entity entityId: EntityIdentifier) -> Bool {
|
public func exists(entity entityId: EntityIdentifier) -> Bool {
|
||||||
componentIdsByEntity.keys.contains(entityId)
|
componentIdsByEntity.keys.contains(entityId)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue