Conform CodingStrategy and EntityIdentifierGenerator to Codable
This commit is contained in:
parent
2333282fd4
commit
40d09a9c3b
|
|
@ -5,7 +5,7 @@
|
|||
// Created by Christian Treffs on 05.08.20.
|
||||
//
|
||||
|
||||
public protocol CodingStrategy {
|
||||
public protocol CodingStrategy: Codable {
|
||||
func codingKey<C>(for componentType: C.Type) -> DynamicCodingKey where C: Component
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
/// It also allows entity ids to be marked as unused (to be re-usable).
|
||||
///
|
||||
/// You should strive to keep entity ids tightly packed around `EntityIdentifier.Identifier.min` since it has an influence on the underlying memory layout.
|
||||
public protocol EntityIdentifierGenerator {
|
||||
public protocol EntityIdentifierGenerator: Codable {
|
||||
/// Initialize the generator providing entity ids to begin with when creating new entities.
|
||||
///
|
||||
/// Entity ids provided should be passed to `nextId()` in last out order up until the collection is empty.
|
||||
|
|
@ -101,3 +101,4 @@ public struct LinearIncrementingEntityIdGenerator: EntityIdentifierGenerator {
|
|||
storage.markUnused(entityId: entityId)
|
||||
}
|
||||
}
|
||||
extension LinearIncrementingEntityIdGenerator.Storage: Codable { }
|
||||
|
|
|
|||
Loading…
Reference in New Issue