Upate license

This commit is contained in:
Christian Treffs 2019-08-01 07:10:22 +02:00
parent 181d8cac51
commit 9252a0b76e
4 changed files with 7 additions and 6 deletions

View File

@ -90,7 +90,7 @@ opt_in_rules:
- unneeded_parentheses_in_closure_argument - unneeded_parentheses_in_closure_argument
- untyped_error_in_catch - untyped_error_in_catch
- unused_import - unused_import
- unused_private_declaration #- unused_private_declaration
- vertical_parameter_alignment_on_call - vertical_parameter_alignment_on_call
- vertical_whitespace_between_cases - vertical_whitespace_between_cases
- vertical_whitespace_closing_braces - vertical_whitespace_closing_braces

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2017 Christian Treffs Copyright (c) 2017-19 Christian Treffs
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -8,11 +8,11 @@
@dynamicMemberLookup @dynamicMemberLookup
public struct ReadableOnly<Comp> where Comp: Component { public struct ReadableOnly<Comp> where Comp: Component {
@usableFromInline let component: Comp @usableFromInline let component: Comp
public init(_ component: Comp) { public init(_ component: Comp) {
self.component = component self.component = component
} }
@inlinable public subscript<C>(dynamicMember keyPath: KeyPath<Comp, C>) -> C { @inlinable public subscript<C>(dynamicMember keyPath: KeyPath<Comp, C>) -> C {
return component[keyPath: keyPath] return component[keyPath: keyPath]
} }
@ -21,11 +21,11 @@ public struct ReadableOnly<Comp> where Comp: Component {
@dynamicMemberLookup @dynamicMemberLookup
public struct Writable<Comp> where Comp: Component { public struct Writable<Comp> where Comp: Component {
@usableFromInline let component: Comp @usableFromInline let component: Comp
public init(_ component: Comp) { public init(_ component: Comp) {
self.component = component self.component = component
} }
@inlinable public subscript<C>(dynamicMember keyPath: ReferenceWritableKeyPath<Comp, C>) -> C { @inlinable public subscript<C>(dynamicMember keyPath: ReferenceWritableKeyPath<Comp, C>) -> C {
nonmutating get { return component[keyPath: keyPath] } nonmutating get { return component[keyPath: keyPath] }
nonmutating set { component[keyPath: keyPath] = newValue } nonmutating set { component[keyPath: keyPath] = newValue }

View File

@ -10,6 +10,7 @@
import FirebladeECS import FirebladeECS
import XCTest import XCTest
class AccessTests: XCTestCase { class AccessTests: XCTestCase {
func testReadOnly() { func testReadOnly() {