Update README for 0.4.0
This commit is contained in:
parent
33d4bf0b85
commit
6c5755324a
|
|
@ -32,7 +32,7 @@ import PackageDescription
|
||||||
let package = Package(
|
let package = Package(
|
||||||
name: "YourPackageName",
|
name: "YourPackageName",
|
||||||
dependencies: [
|
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: [
|
targets: [
|
||||||
.target(
|
.target(
|
||||||
|
|
@ -88,7 +88,7 @@ A family that containts only entities with a `Movement` and `PlayerInput` compon
|
||||||
```swift
|
```swift
|
||||||
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
|
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
|
||||||
excludesAll: [Texture.self],
|
excludesAll: [Texture.self],
|
||||||
any: [Name.self])
|
needsAtLeastOne: [Name.self])
|
||||||
```
|
```
|
||||||
|
|
||||||
These entities are cached in the nexus for efficient access and iteration.
|
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 {
|
class PlayerMovementSystem {
|
||||||
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
|
let family = nexus.family(requiresAll: [Movement.self, PlayerInput.self],
|
||||||
excludesAll: [Texture.self],
|
excludesAll: [Texture.self],
|
||||||
any: [Name.self])
|
needsAtLeastOne: [Name.self])
|
||||||
|
|
||||||
func update() {
|
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
|
// position & velocity for the current entity
|
||||||
// we know that we will have this component so we force unwrap the component
|
// we know that we will have this component so we force unwrap the component
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue