diff --git a/Makefile b/Makefile index 5008046..d95052b 100644 --- a/Makefile +++ b/Makefile @@ -62,4 +62,4 @@ setupEnvironment: brew install sourcery generateCode: - sourcery --verbose \ No newline at end of file + sourcery --config ./.sourcery.yml --verbose \ No newline at end of file diff --git a/Sources/FirebladeECS/Stencils/Family.stencil b/Sources/FirebladeECS/Stencils/Family.stencil index 865780c..e01b327 100644 --- a/Sources/FirebladeECS/Stencils/Family.stencil +++ b/Sources/FirebladeECS/Stencils/Family.stencil @@ -20,8 +20,10 @@ {% set CompsLowercased %}{{compsLowercased|join: ", "}}{% endset %} {% map components into compsTuple using comp %}components.{{ maploop.counter }}{% endmap %} {% set CompsTuple %}{{compsTuple|join: ", "}}{% endset %} -{% map components into compsParams using comp %}{% if not maploop.first %}_ {% endif %}{{ comp|lowercase }}: {{ comp }}.Type{% endmap %} -{% set CompsParams %}{{compsParams|join: ", "}}{% endset %} +{% map components into compsTypeParams using comp %}{% if not maploop.first %}_ {% endif %}{{ comp|lowercase }}: {{ comp }}.Type{% endmap %} +{% set CompsTypeParams %}{{compsTypeParams|join: ", "}}{% endset %} +{% map components into compsNamedParams using comp %}{% if not maploop.first %}_ {% endif %}{{ comp|lowercase }}: {{ comp }}{% endmap %} +{% set CompsNamedParams %}{{compsNamedParams|join: ", "}}{% endset %} // MARK: - Family {{ idx }} @@ -123,7 +125,7 @@ extension Nexus { /// - excludedComponents: All component types that must not be assigned to an entity in this family. /// - Returns: The family of entities having {{ components.count }} required components each. public func family<{{ CompParams }}>( - {% if components.count == 1 %}requires{% else %}requiresAll{%endif%} {{ CompsParams }}, + {% if components.count == 1 %}requires{% else %}requiresAll{%endif%} {{ CompsTypeParams }}, excludesAll excludedComponents: Component.Type... ) -> Family{{ idx }}<{{ CompParams }}> where {{ CompsWhere }} { Family{{ idx }}<{{ CompParams }}>(