From 35f733bd967e2c536e72aaad5dc8e2eeb4b8fc3f Mon Sep 17 00:00:00 2001 From: Christian Treffs Date: Tue, 4 Aug 2020 17:22:18 +0200 Subject: [PATCH] Update documentation --- .../Generated/Family.generated.swift | 62 +++++++++---------- Sources/FirebladeECS/Stencils/Family.stencil | 14 ++--- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Sources/FirebladeECS/Generated/Family.generated.swift b/Sources/FirebladeECS/Generated/Family.generated.swift index 5150709..a57c990 100644 --- a/Sources/FirebladeECS/Generated/Family.generated.swift +++ b/Sources/FirebladeECS/Generated/Family.generated.swift @@ -55,18 +55,18 @@ extension Requires1: FamilyDecoding where Comp1: Decodable { extension Nexus { /// Create a family of entities (aka members) having 1 required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the 1 required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the 1 required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift - /// let family = nexus.family(requiresAll: Comp1.self) + /// let family = nexus.family(requires: Comp1.self) /// // iterate each entity's components /// family.forEach { (comp1) in /// ... @@ -147,16 +147,16 @@ extension Requires2: FamilyDecoding where Comp1: Decodable, Comp2: Decodable { extension Nexus { /// Create a family of entities (aka members) having 2 required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the 2 required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the 2 required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift /// let family = nexus.family(requiresAll: Comp1.self, Comp2.self) /// // iterate each entity's components @@ -246,16 +246,16 @@ extension Requires3: FamilyDecoding where Comp1: Decodable, Comp2: Decodable, Co extension Nexus { /// Create a family of entities (aka members) having 3 required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the 3 required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the 3 required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift /// let family = nexus.family(requiresAll: Comp1.self, Comp2.self, Comp3.self) /// // iterate each entity's components @@ -352,16 +352,16 @@ extension Requires4: FamilyDecoding where Comp1: Decodable, Comp2: Decodable, Co extension Nexus { /// Create a family of entities (aka members) having 4 required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the 4 required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the 4 required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift /// let family = nexus.family(requiresAll: Comp1.self, Comp2.self, Comp3.self, Comp4.self) /// // iterate each entity's components @@ -465,16 +465,16 @@ extension Requires5: FamilyDecoding where Comp1: Decodable, Comp2: Decodable, Co extension Nexus { /// Create a family of entities (aka members) having 5 required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the 5 required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the 5 required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift /// let family = nexus.family(requiresAll: Comp1.self, Comp2.self, Comp3.self, Comp4.self, Comp5.self) /// // iterate each entity's components diff --git a/Sources/FirebladeECS/Stencils/Family.stencil b/Sources/FirebladeECS/Stencils/Family.stencil index 853044c..2894c37 100644 --- a/Sources/FirebladeECS/Stencils/Family.stencil +++ b/Sources/FirebladeECS/Stencils/Family.stencil @@ -94,18 +94,18 @@ extension Requires{{ idx }}: FamilyDecoding where {{ CompsWhereDecodable }} { extension Nexus { /// Create a family of entities (aka members) having {{ components.count }} required components. /// - /// A family is a collection of entities with uniform components per entity. - /// Entities that will be part of this family will have at least the {{ components.count }} required components, + /// A family is a collection of entities with uniform component types per entity. + /// Entities that are be part of this family will have at least the {{ components.count }} required components, /// but may have more components assigned. /// - /// Families are just views on data, creating them is cheap. + /// A family is just a view on (component) data, creating them is cheap. /// Use them to iterate efficiently over entities with the same components assigned. - /// Families of the same requirements provide a view on the same collection of entities. - /// Each family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. + /// Families with the same requirements provide a view on the same collection of entities (aka members). + /// A family conforms to the `LazySequenceProtocol` and therefore can be accessed like any other (lazy) sequence. /// - /// **Usage example:** + /// **General usage:** /// ```swift - /// let family = nexus.family(requiresAll: {{ CompsSelf }}) + /// let family = nexus.family({% if components.count == 1 %}requires{% else %}requiresAll{%endif%}: {{ CompsSelf }}) /// // iterate each entity's components /// family.forEach { ({{ CompsLowercased }}) in /// ...