Resolve component collision decission
This commit is contained in:
parent
f7d2a5b3a2
commit
13dc68dc26
|
|
@ -28,11 +28,8 @@ public extension Nexus {
|
|||
|
||||
/// test if component is already assigned
|
||||
guard !has(componentId: componentId, entityIdx: entityIdx) else {
|
||||
// FIXME: this is still open to debate
|
||||
// a) we replace the component
|
||||
// b) we copy the properties
|
||||
// c) we assert fail
|
||||
report("ComponentAdd collision: \(entityIdx) already has a component \(component)")
|
||||
assertionFailure("ComponentAdd collision: \(entityIdx) already has a component \(component)")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class NexusTests: XCTestCase {
|
|||
let p0 = Position(x: 1, y: 2)
|
||||
|
||||
e0.assign(p0)
|
||||
e0.assign(p0)
|
||||
// component collision: e0.assign(p0)
|
||||
|
||||
XCTAssert(e0.hasComponents)
|
||||
XCTAssert(e0.numComponents == 1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue