Use Identifier in EntityId generator
This commit is contained in:
parent
5696b5612d
commit
af81c88a51
|
|
@ -32,12 +32,12 @@ public protocol EntityIdentifierGenerator {
|
||||||
public struct DefaultEntityIdGenerator: EntityIdentifierGenerator {
|
public struct DefaultEntityIdGenerator: EntityIdentifierGenerator {
|
||||||
@usableFromInline
|
@usableFromInline
|
||||||
final class Storage {
|
final class Storage {
|
||||||
@usableFromInline var stack: [UInt32]
|
@usableFromInline var stack: [EntityIdentifier.Identifier]
|
||||||
@usableFromInline var count: Int { stack.count }
|
@usableFromInline var count: Int { stack.count }
|
||||||
|
|
||||||
@usableFromInline
|
@usableFromInline
|
||||||
init(inUse entityIds: [EntityIdentifier]) {
|
init(inUse entityIds: [EntityIdentifier]) {
|
||||||
stack = entityIds.reversed().map { UInt32($0.id) }
|
stack = entityIds.reversed().map(\.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@usableFromInline
|
@usableFromInline
|
||||||
|
|
@ -52,7 +52,7 @@ public struct DefaultEntityIdGenerator: EntityIdentifierGenerator {
|
||||||
|
|
||||||
@usableFromInline
|
@usableFromInline
|
||||||
func markUnused(entityId: EntityIdentifier) {
|
func markUnused(entityId: EntityIdentifier) {
|
||||||
stack.append(UInt32(entityId.id))
|
stack.append(entityId.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue