Lint
This commit is contained in:
parent
dc1d2f67b4
commit
2e6ecdf104
|
|
@ -35,10 +35,11 @@ extension Nexus {
|
||||||
convenience init(from sNexus: SNexus) throws {
|
convenience init(from sNexus: SNexus) throws {
|
||||||
let entityIds = sNexus.entities.map { $0.key }.reversed()
|
let entityIds = sNexus.entities.map { $0.key }.reversed()
|
||||||
|
|
||||||
|
// FIXME: this does not respect the generator of the target nexus!
|
||||||
self.init(entityStorage: UnorderedSparseSet(),
|
self.init(entityStorage: UnorderedSparseSet(),
|
||||||
componentsByType: [:],
|
componentsByType: [:],
|
||||||
componentsByEntity: [:],
|
componentsByEntity: [:],
|
||||||
entityIdGenerator: DefaultEntityIdGenerator(startProviding: entityIds), // FIXME: this does not respect the generator of the target nexus!
|
entityIdGenerator: DefaultEntityIdGenerator(startProviding: entityIds),
|
||||||
familyMembersByTraits: [:],
|
familyMembersByTraits: [:],
|
||||||
codingStrategy: DefaultCodingStrategy())
|
codingStrategy: DefaultCodingStrategy())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,11 @@ public final class SerializationTests: XCTestCase {
|
||||||
let e3 = nexus.createEntity()
|
let e3 = nexus.createEntity()
|
||||||
nexus.createEntity(with: Position(x: 5, y: 18), Name(name: "yourName"))
|
nexus.createEntity(with: Position(x: 5, y: 18), Name(name: "yourName"))
|
||||||
|
|
||||||
|
|
||||||
// Fragment entities
|
// Fragment entities
|
||||||
nexus.destroy(entity: e2)
|
nexus.destroy(entity: e2)
|
||||||
nexus.destroy(entity: e3)
|
nexus.destroy(entity: e3)
|
||||||
nexus.destroy(entity: e1)
|
nexus.destroy(entity: e1)
|
||||||
|
|
||||||
let encoder = JSONEncoder()
|
let encoder = JSONEncoder()
|
||||||
let data = try encoder.encode(nexus)
|
let data = try encoder.encode(nexus)
|
||||||
|
|
||||||
|
|
@ -43,7 +42,7 @@ public final class SerializationTests: XCTestCase {
|
||||||
let firstEntity = nexus.createEntity(with: Name(name: "myName"), Position(x: 1, y: 2))
|
let firstEntity = nexus.createEntity(with: Name(name: "myName"), Position(x: 1, y: 2))
|
||||||
let e3 = nexus.createEntity()
|
let e3 = nexus.createEntity()
|
||||||
let secondEntity = nexus.createEntity(with: Velocity(a: 3.14), Party(partying: true))
|
let secondEntity = nexus.createEntity(with: Velocity(a: 3.14), Party(partying: true))
|
||||||
|
|
||||||
// Fragment entities
|
// Fragment entities
|
||||||
nexus.destroy(entity: e2)
|
nexus.destroy(entity: e2)
|
||||||
nexus.destroy(entity: e3)
|
nexus.destroy(entity: e3)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue