autoupdate manifest
This commit is contained in:
parent
1c8c063e01
commit
39692bbfc2
|
|
@ -344,7 +344,7 @@ public class EntityStateMachine<StateName: Hashable> {
|
||||||
|
|
||||||
for (identifier, _) in currentState.providers {
|
for (identifier, _) in currentState.providers {
|
||||||
if let other = toAdd[identifier], let current = currentState.providers[identifier],
|
if let other = toAdd[identifier], let current = currentState.providers[identifier],
|
||||||
current.identifier == other.identifier {
|
current.identifier == other.identifier {
|
||||||
toAdd[identifier] = nil
|
toAdd[identifier] = nil
|
||||||
} else {
|
} else {
|
||||||
entity.remove(identifier)
|
entity.remove(identifier)
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ class EntityStateMachineTests: XCTestCase {
|
||||||
XCTAssertTrue(entity.get(component: MockComponent.self) === component1)
|
XCTAssertTrue(entity.get(component: MockComponent.self) === component1)
|
||||||
XCTAssertTrue(entity.get(component: MockComponent2.self) === component2)
|
XCTAssertTrue(entity.get(component: MockComponent2.self) === component2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testGetsDeinitedWhileBeingStronglyReferencedByComponentAssignedToEntity() {
|
func testGetsDeinitedWhileBeingStronglyReferencedByComponentAssignedToEntity() {
|
||||||
class Marker: Component {
|
class Marker: Component {
|
||||||
let fsm: EntityStateMachine<String>
|
let fsm: EntityStateMachine<String>
|
||||||
|
|
@ -421,7 +421,7 @@ class EntityStateMachineTests: XCTestCase {
|
||||||
self.fsm = fsm
|
self.fsm = fsm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let nexus = Nexus()
|
let nexus = Nexus()
|
||||||
var entity = nexus.createEntity()
|
var entity = nexus.createEntity()
|
||||||
var markerComponent = Marker(fsm: EntityStateMachine<String>(entity: entity))
|
var markerComponent = Marker(fsm: EntityStateMachine<String>(entity: entity))
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,8 @@ extension EntityStateMachineTests {
|
||||||
("testEnterSecondStateDoesNotRemoveOverlappingComponents", testEnterSecondStateDoesNotRemoveOverlappingComponents),
|
("testEnterSecondStateDoesNotRemoveOverlappingComponents", testEnterSecondStateDoesNotRemoveOverlappingComponents),
|
||||||
("testEnterSecondStateRemovesDifferentComponentsOfSameType", testEnterSecondStateRemovesDifferentComponentsOfSameType),
|
("testEnterSecondStateRemovesDifferentComponentsOfSameType", testEnterSecondStateRemovesDifferentComponentsOfSameType),
|
||||||
("testEnterSecondStateRemovesFirstStatesComponents", testEnterSecondStateRemovesFirstStatesComponents),
|
("testEnterSecondStateRemovesFirstStatesComponents", testEnterSecondStateRemovesFirstStatesComponents),
|
||||||
("testEnterStateAddsStatesComponents", testEnterStateAddsStatesComponents)
|
("testEnterStateAddsStatesComponents", testEnterStateAddsStatesComponents),
|
||||||
|
("testGetsDeinitedWhileBeingStronglyReferencedByComponentAssignedToEntity", testGetsDeinitedWhileBeingStronglyReferencedByComponentAssignedToEntity)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue