-
-
Notifications
You must be signed in to change notification settings - Fork 12
Parameter Packs for ECS #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4c8d36b
chore(conductor): Add new track 'Refactor the ECS to exclusively use …
ctreffs 6291877
feat(phase): Complete API Design & Prototyping
ctreffs 3d59f31
feat(phase): Complete Core Refactoring (Family & Nexus) including Cod…
ctreffs 7836aec
feat(phase): Complete API Adoption & Cleanup
ctreffs 7dd4317
chore(conductor): Mark track 'Refactor the ECS to exclusively use par…
ctreffs 0bb44ab
feat(tests): Add comprehensive component tests (1-8) and fix encoding
ctreffs 114f8ff
chore(conductor): Mark track 'Refactor the ECS to exclusively use par…
ctreffs 923c85e
No conductor files
ctreffs c507b3d
Cleanups
ctreffs 4783ea7
fix(review): Address PR feedback (restore Sequence, Coding, optimize …
ctreffs 9fc888b
fix(docs): Update documentation and address remaining review comments
ctreffs 76114b7
docs(conductor): Update plan with review tasks
ctreffs ce2b5d5
fix(coding): Restore Coding Feature Parity and Fix Tests
ctreffs b5126c6
docs(conductor): Update plan with coding parity task
ctreffs d4147c1
Restore family
ctreffs 2b925a3
Restore Family+Coding [broken]
ctreffs 6702b6a
Valid updates
ctreffs c863cd1
Coding
ctreffs b233795
Reset original benchmark code
ctreffs 284e992
Remove conductor files
ctreffs 689f29e
Pre-commit lint-fix
ctreffs 7113bf9
Restore api.
ctreffs cde2c27
Fix FamilyMemberContainer
ctreffs 2840d92
Finalize
ctreffs 62a8046
Re-add require one component
ctreffs 0876af9
Restore require API
ctreffs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| realm/SwiftLint@0.63.2 | ||
| nicklockwood/SwiftFormat@0.59.1 | ||
| krzysztofzablocki/Sourcery@2.3.0 | ||
| ldomaradzki/xcsift@v1.1.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| // | ||
| // Family+Coding+Foundation.swift | ||
| // FirebladeECS | ||
| // | ||
| // Created by Christian Treffs on 13.02.26. | ||
| // | ||
|
|
||
| #if canImport(Foundation) | ||
| import Foundation | ||
|
|
||
| extension Family where repeat each C: Encodable { | ||
| /// Encode family members (entities) to data using a given encoder. | ||
| /// | ||
| /// The encoded members will *NOT* be removed from the nexus and will also stay present in this family. | ||
| /// - Parameter encoder: The data encoder. Data encoder respects the coding strategy set at `nexus.codingStrategy`. | ||
| /// - Returns: The encoded data. | ||
| /// - Complexity: O(N) where N is the number of family members. | ||
| public func encodeMembers(using encoder: inout JSONEncoder) throws -> Data { | ||
| encoder.userInfo[CodingUserInfoKey.nexusCodingStrategy] = nexus.codingStrategy | ||
| let container = FamilyMemberContainer<repeat each C>(components: makeIterator()) | ||
| return try encoder.encode(container) | ||
| } | ||
| } | ||
|
|
||
| extension Family where repeat each C: Decodable { | ||
| /// Decode family members (entities) from given data using a decoder. | ||
| /// | ||
| /// The decoded members will be added to the nexus and will be present in this family. | ||
| /// - Parameters: | ||
| /// - 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`. | ||
| /// - Returns: returns the newly added entities. | ||
| /// - Complexity: O(N) where N is the number of family members in the data. | ||
| @discardableResult | ||
| public func decodeMembers(from data: Data, using decoder: inout JSONDecoder) throws -> [Entity] { | ||
| decoder.userInfo[CodingUserInfoKey.nexusCodingStrategy] = nexus.codingStrategy | ||
| let familyMembers = try decoder.decode(FamilyMemberContainer<repeat each C>.self, from: data) | ||
| return familyMembers.components | ||
| .map { (memberComponents: (repeat each C)) in | ||
| createMember(with: repeat each memberComponents) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.