Fix typos
This commit is contained in:
parent
e78559ca9c
commit
eeb789f041
12
README.md
12
README.md
|
|
@ -90,7 +90,7 @@ Entities with the __same component types__ may belong to one `Family`.
|
||||||
A `Family` has entities as members and component types as family traits.
|
A `Family` has entities as members and component types as family traits.
|
||||||
|
|
||||||
Create a family by calling `.family` with a set of traits on the nexus.
|
Create a family by calling `.family` with a set of traits on the nexus.
|
||||||
A family that containts only entities with a `Movement` and `PlayerInput` component, but no `Texture` component is created by
|
A family that contains only entities with a `Movement` and `PlayerInput` component, but no `Texture` component is created by
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
let family = nexus.family(requiresAll: Movement.self, PlayerInput.self,
|
let family = nexus.family(requiresAll: Movement.self, PlayerInput.self,
|
||||||
|
|
@ -100,7 +100,7 @@ let family = nexus.family(requiresAll: Movement.self, PlayerInput.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.
|
||||||
Families conform to the [Sequence](https://developer.apple.com/documentation/swift/sequence) protocol so that members (components)
|
Families conform to the [Sequence](https://developer.apple.com/documentation/swift/sequence) protocol so that members (components)
|
||||||
may be iterated and accessed like any other sequence in Swift.
|
may be iterated and accessed like any other sequence in Swift.
|
||||||
Access a familiy's components directly on the family instance. To get family entities and access components at the same time call `family.entityAndComponents`.
|
Access a family's components directly on the family instance. To get family entities and access components at the same time call `family.entityAndComponents`.
|
||||||
If you are only interested in a family's entities call `family.entities`.
|
If you are only interested in a family's entities call `family.entities`.
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
|
|
@ -134,7 +134,7 @@ class PlayerMovementSystem {
|
||||||
.entityAndComponents
|
.entityAndComponents
|
||||||
.forEach { (entity: Entity, mov: Movement, input: PlayerInput) in
|
.forEach { (entity: Entity, mov: Movement, input: PlayerInput) in
|
||||||
|
|
||||||
// the currenty entity instance
|
// the current entity instance
|
||||||
_ = entity
|
_ = entity
|
||||||
|
|
||||||
// position & velocity component for the current entity
|
// position & velocity component for the current entity
|
||||||
|
|
@ -152,7 +152,7 @@ class PlayerMovementSystem {
|
||||||
.entities
|
.entities
|
||||||
.forEach { (entity: Entity) in
|
.forEach { (entity: Entity) in
|
||||||
|
|
||||||
// the currenty entity instance
|
// the current entity instance
|
||||||
_ = entity
|
_ = entity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -188,8 +188,8 @@ class GameLogicSystem {
|
||||||
### 👫 Relatives
|
### 👫 Relatives
|
||||||
|
|
||||||
This ECS implementation provides an integrated way of creating a [directed acyclic graph (DAG)](https://en.wikipedia.org/wiki/Directed_acyclic_graph) hierarchy of entities by forming parent-child relationships. Entities can become children of a parent entity. In family terms they become **relatives**. Families provide iteration over these relationships.
|
This ECS implementation provides an integrated way of creating a [directed acyclic graph (DAG)](https://en.wikipedia.org/wiki/Directed_acyclic_graph) hierarchy of entities by forming parent-child relationships. Entities can become children of a parent entity. In family terms they become **relatives**. Families provide iteration over these relationships.
|
||||||
The entity hierachy implementation does not use an additional component therefore keeping the hierarchy intact over different component-families.
|
The entity hierarchy implementation does not use an additional component therefore keeping the hierarchy intact over different component-families.
|
||||||
This feature is especially useful for implenting a [scene graph](https://en.wikipedia.org/wiki/Scene_graph).
|
This feature is especially useful for implementing a [scene graph](https://en.wikipedia.org/wiki/Scene_graph).
|
||||||
|
|
||||||
```swift
|
```swift
|
||||||
// create entities with 0 to n components
|
// create entities with 0 to n components
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ extension Family where R: FamilyDecoding {
|
||||||
///
|
///
|
||||||
/// The decoded members will be added to the nexus and will be present in this family.
|
/// The decoded members will be added to the nexus and will be present in this family.
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
/// - data: The data decoded by decoder. A unkeyed container of family members (keyed component containers) is expected.
|
/// - data: The data decoded by decoder. An unkeyed container of family members (keyed component containers) is expected.
|
||||||
/// - decoder: The decoder to use for decoding family member data. Decoder respects the coding strategy set at `nexus.codingStrategy`.
|
/// - decoder: The decoder to use for decoding family member data. Decoder respects the coding strategy set at `nexus.codingStrategy`.
|
||||||
/// - Returns: returns the newly added entities.
|
/// - Returns: returns the newly added entities.
|
||||||
@discardableResult
|
@discardableResult
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue