Update korge-fleks to version 1.6-KMP #988
Merged
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.
The sources in korge-fleks module were updated to Fleks upstream version 1.6-KMP. The sample sources in korge-sandbox were updated to use the new DSL notation for creating a world.
Change log for Fleks since last update:
BUGFIX: fix an issue that entities did not get removed from families that only used the noneOf configuration. The reason is that a removed entity has no components which is then actually valid for such families. However, a removed entity should of course be removed from any family ;)
UPDATE: BitArray has a new toString function which makes it easier to debug certain things.
NEW: new snapshot and snapshotOf function for the World to get a snapshot of the entire world (=entities and components) or of a specific entity. This should also help with debugging. A new page to the Fleks Wiki was added as well regarding debugging.
NEW: new loadSnapshot function for the World to load a specific snapshot. This will clear the current world and create entities and components according to the provided snapshot.
BUGFIX: fixed numEntities of a family to return the correct number of entities instead of the highest ID of any entity inside the family
NEW: added isEmpty, isNotEmpty, first and firstOrNull functions to a family
BUGFIX: Entities created inside a system's constructor are now properly added to their family and also EntityListener get notified correctly in this case
BUGFIX: ComponentListener did not get notified when entities are created in a system's init block
UPDATE: the used parameter of an injectable is removed because injectables are now properly resolved and cleared once the world is created
UPDATE: minor memory management improvements
NEW: make world a default dependency for the dependency injection mechanism. That way it is now possible to easily pass the world to a ComponentListener
NEW: add getter for world's systems
NEW: add configureEntity to world. This makes it now possible to modify an entity outside of a system as requested in the comments section of my YouTube channel
NEW: add support to create families out of a system via the world. This is the biggest change of this version and adds new flexibility on how to handle and iterate over entities with specific component configurations
NEW: users have now access to the family of an IteratingSystem
NEW: family now also contains a configureEntity function which allows users to modify an entity outside of a system in a convenient way
NEW: a new FamilyListener support is added which allows users to react on when an entity is added to, or removed from a family
NEW: new DSL to create a world. Use components , systems, injectables or families block to define your world. For more details, refer to the ReadMe
NEW: the KMP setup was updated to a proper multiplatform gradle setup. That way it is now possible to add Fleks to a KorGE dependency via following line in the korge block:
dependencyMulti("io.github.quillraven.fleks:Fleks:1.6-KMP",
registerPlugin = false)