commit
d8ce40b9c3
|
|
@ -35,7 +35,7 @@ import PackageDescription
|
|||
let package = Package(
|
||||
name: "YourPackageName",
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.16.0")
|
||||
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.17.0")
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ extension Entity {
|
|||
public subscript<C: Component, Value>(_ componentKeyPath: WritableKeyPath<C, Value>) -> Value? {
|
||||
nonmutating set {
|
||||
guard var comp = self.get(component: C.self),
|
||||
let value = newValue else {
|
||||
return
|
||||
let value = newValue else {
|
||||
return
|
||||
}
|
||||
comp[keyPath: componentKeyPath] = value
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = entity
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -86,7 +86,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
.forEach { (position: Position) in
|
||||
_ = position
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, numEntities * 10)
|
||||
|
|
@ -110,7 +110,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = position
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -136,7 +136,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = position
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -161,7 +161,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = velocity
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -187,7 +187,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = velocity
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -212,7 +212,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = name
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -239,7 +239,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = name
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -265,7 +265,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = color
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -293,7 +293,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = color
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
@ -348,7 +348,7 @@ class TypedFamilyPerformanceTests: XCTestCase {
|
|||
_ = empty
|
||||
|
||||
loopCount += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(loopCount, family.count * 10)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class ColorSystem {
|
|||
color.r = 1
|
||||
color.g = 2
|
||||
color.b = 3
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -148,6 +148,6 @@ class PositionSystem {
|
|||
|
||||
pos.x = x
|
||||
pos.y = y
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class FamilyTests: XCTestCase {
|
|||
.forEach { (entity: Entity, _: Position) in
|
||||
entity.assign(Velocity(a: 3.14))
|
||||
entity.remove(Position.self)
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(familyA.count, 0)
|
||||
XCTAssertEqual(familyB.count, 10)
|
||||
|
|
@ -131,7 +131,7 @@ class FamilyTests: XCTestCase {
|
|||
.forEach { (entity: Entity, velocity: Velocity) in
|
||||
entity.assign(Position(x: 1, y: 2))
|
||||
entity.remove(velocity)
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(familyA.count, 10)
|
||||
XCTAssertEqual(familyB.count, 0)
|
||||
|
|
@ -176,7 +176,7 @@ class FamilyTests: XCTestCase {
|
|||
.prefix(currentCount)
|
||||
.forEach { (entity: Entity) in
|
||||
entity.destroy()
|
||||
}
|
||||
}
|
||||
|
||||
XCTAssertEqual(family.memberIds.count, (count / 2))
|
||||
|
||||
|
|
|
|||
|
|
@ -113,6 +113,6 @@ class SystemsTests: XCTestCase {
|
|||
.prefix(count)
|
||||
.forEach { (entity: Entity) in
|
||||
entity.destroy()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue