Update README for 0.4.0

This commit is contained in:
Christian Treffs 2018-05-10 16:13:03 +02:00
parent 33d4bf0b85
commit 6c5755324a
1 changed files with 8 additions and 8 deletions

View File

@ -32,7 +32,7 @@ import PackageDescription
let package = Package(
name: "YourPackageName",
dependencies: [
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.3.0")
.package(url: "https://github.com/fireblade-engine/ecs.git", from: "0.4.0")
],
targets: [
.target(
@ -88,7 +88,7 @@ A family that containts only entities with a `Movement` and `PlayerInput` compon
```swift
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
excludesAll: [Texture.self],
any: [Name.self])
needsAtLeastOne: [Name.self])
```
These entities are cached in the nexus for efficient access and iteration.
@ -100,10 +100,10 @@ followed by the typesafe component instances of the current entity that you may
class PlayerMovementSystem {
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
excludesAll: [Texture.self],
any: [Name.self])
needsAtLeastOne: [Name.self])
func update() {
family.iterate { (_, mov: Movement!, input: PlayerInput!, name: Name?) in
family.iterate { (mov: Movement!, input: PlayerInput!, name: Name?) in
// position & velocity for the current entity
// we know that we will have this component so we force unwrap the component