Fix build for Swift 5.0.1

This commit is contained in:
Christian Treffs 2019-08-22 13:44:01 +02:00
parent 0bc2d8cb8a
commit 2084e04257
4 changed files with 16 additions and 3 deletions

View File

@ -5,6 +5,7 @@
// Created by Christian Treffs on 25.06.19.
//
#if swift(>=5.1)
@dynamicMemberLookup
public struct ReadableOnly<Comp> where Comp: Component {
@usableFromInline let component: Comp
@ -31,3 +32,4 @@ public struct Writable<Comp> where Comp: Component {
nonmutating set { component[keyPath: keyPath] = newValue }
}
}
#endif

View File

@ -104,4 +104,9 @@ public struct Entity {
}
// MARK: - Equatable
extension Entity: Equatable { }
extension Entity: Equatable {
public static func == (lhs: Entity, rhs: Entity) -> Bool {
return lhs.nexus == rhs.nexus &&
lhs.identifier == rhs.identifier
}
}

View File

@ -124,4 +124,9 @@ extension Family {
extension Family.EntityComponentIterator: LazySequenceProtocol { }
// MARK: - Equatable
extension Family: Equatable { }
extension Family: Equatable {
public static func == (lhs: Family<R>, rhs: Family<R>) -> Bool {
return lhs.nexus == rhs.nexus &&
lhs.traits == rhs.traits
}
}

View File

@ -10,7 +10,7 @@
import FirebladeECS
import XCTest
#if swift(>=5.1)
class AccessTests: XCTestCase {
func testReadOnly() {
@ -42,3 +42,4 @@ class AccessTests: XCTestCase {
}
}
#endif