Releases: Quillraven/Fleks
2.2
- BUGFIX: fixed an issue that was introduced in version 2.1 which caused families to not get updated properly when used in a nested iteration way. Thanks to @ernespn for reporting this issue!
- NEW: added the
getoperator to theEntityBaginterface. This allows to do a normal for loop over a family. Thanks to @ScottHamper for the proposal and contribution! - UPDATE: updated Kotlin to 1.7.21
2.1
A small update that brings some collection functionality when working with entities (EntityBag):
- UPDATE: Kotlin and Dokka to 1.7.20
- UPDATE: change
Entityback to value class instead of data class - UPDATE: nested calls of
entityandentity.configureare now possible. Also, the documentation of those two functions got updated to point out a potential risk. - NEW: add entity
containsfunction tofamily - UPDATE:
IntBagis now split into two classes:EntityBagandMutableEntityBag. You can use them in your own game if you want. - NEW: add a lot of collection functionality to
EntityBag(thanks to @rubybrowncoat for the suggestion):sizecontains,containsAllisEmpty,isNotEmptyall,any,noneassociate,associateBy,associateTo,associateByTocountfilter,filterNot,filterIndexed,filterTo,filterNotTo,filterIndexedTofindfirst,firstOrNullfold,foldIndexedforEach,forEachIndexedmap,mapIndexed,mapTo,mapIndexedTo,mapNotNull,mapNotNullTorandom,randomOrNulltakegroupBy,groupByToflatMap,flatMapSequence,flatMapBag,flatMapNotNull,flatMapSequenceNotNull,flatMapBagNotNull
2.0
After almost one year, this release finally combines the JVM and KMP releases into one single release. I also tried to simplify Fleks for newcomers and be more consistent with the way of Kotlin, resulting in more concise and readable code.
This has the sideeffect, that there are several breaking changes in version 2.0 and you cannot simply upgrade from either 1.6-JVM or 1.6-KMP because of those API changes.
For more details, please check out the wiki which contains both, the hold and new API documentation.
If you want to migrate then also please have a look at this youtube video from myself, where I migrate some code segments from 1.6-JVM to 2.0.
I hope you like the new changes and try it out!
Special shout outs to @jobe-m and @czyzby who helped with the development of 2.0 by giving feedback and suggestions. And also for the verification in a KorGE game setup (jobe-m). Thanks!
1.6-KMP
This release fixes a rare bug and improves the debugging capabilities of Fleks. In addition, it is now possible to load a specific "snapshot" for your world.
- BUGFIX: fix an issue that entities did not get removed from families that only used the
noneOfconfiguration. 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:
BitArrayhas a newtoStringfunction which makes it easier to debug certain things. - NEW: new
snapshotandsnapshotOffunction for theWorldto 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 Wiki was added as well regarding debugging. - NEW: new
loadSnapshotfunction for theWorldto load a specific snapshot. This will clear the current world and create entities and components according to the provided snapshot. - Gradle got updated from 7.5 to 7.5.1
1.6-JVM
This release fixes a rare bug and improves the debugging capabilities of Fleks. In addition, it is now possible to load a specific "snapshot" for your world.
- BUGFIX: fix an issue that entities did not get removed from families that only used the
noneOfconfiguration. 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:
BitArrayhas a newtoStringfunction which makes it easier to debug certain things. - NEW: new
snapshotandsnapshotOffunction for theWorldto 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 Wiki was added as well regarding debugging. - NEW: new
loadSnapshotfunction for theWorldto load a specific snapshot. This will clear the current world and create entities and components according to the provided snapshot. - Gradle got updated from 7.5 to 7.5.1
As always, KMP version will be released a few days later.
1.5-KMP
This is a small release that brings in an important bugfix, some utility functions for families and some internal version upgrades:
- BUGFIX: fixed
numEntitiesof a family to return the correct number of entities instead of the highest ID of any entity inside the family - NEW: added
isEmpty,isNotEmpty,firstandfirstOrNullfunctions to a family - Update Kotlin version to 1.7.10
- Update Gradle to 7.5
1.5-JVM
This is a small release that brings in an important bugfix, some utility functions for families and some internal version upgrades:
- BUGFIX: fixed
numEntitiesof a family to return the correct number of entities instead of the highest ID of any entity inside the family - NEW: added
isEmpty,isNotEmpty,firstandfirstOrNullfunctions to a family - Update Kotlin version to 1.7.10
- Update Gradle to 7.5
1.4-JVM
This is a small update to the JVM version containing the new DSL to create and configure a world, which was added in the latest KMP version.
JVM and KMP are now up-to-date again featurewise.
Be aware, that this version contains a breaking change when it comes to creating a world. This must be done via the new DSL.
Also, the wiki got updated and the API/example area is now removed from the ReadMe file. Everything got moved to the wiki which also contains the documentation for the new DSL!
1.4-KMP-RC1
One bigger release for the KMP version of Fleks bringing all the changes done in the JVM version since 1.1 into it. In addition, a new DSL was added to configure a world in a nicer way.
Also, the project setup was converted from a JVM project to a real Kotlin multiplatform project with different sourceSets for the different targets. This makes it now possible to add Fleks via normal dependencies to a KMP project like e.g. in a KorGE game.
Refer to the full changelog below:
Changelog:
- BUGFIX: Entities created inside a system's constructor are now properly added to their family and also
EntityListenerget notified correctly in this case - BUGFIX:
ComponentListenerdid not get notified when entities are created in a system'sinitblock - UPDATE: change dokka from 1.6.10 to 1.6.21
- UPDATE: the
usedparameter 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
configureEntityto 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
familyof anIteratingSystem - NEW:
familynow also contains aconfigureEntityfunction which allows users to modify an entity outside of a system in a convenient way - NEW: a new
FamilyListenersupport is added which allows users to react on when an entity is added to, or removed from afamily - NEW: new DSL to create a world. Use
components,systems,injectablesorfamiliesblock 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
korgeblockdependencyMulti("io.github.quillraven.fleks:Fleks:1.3-KMP", registerPlugin = false)
1.3-JVM
Another update within a short period of time because the last version introduced a bug. I should not work an releases ~midnight time - note to myself for the future! :)
Anyway, here is the changelog:
- BUGFIX:
ComponentListenerdid not get notified when entities are created in a system'sinitblock - BUGFIX: nested
Familyiteration was not properly handled when entities got removed during iteration. The entity removal delay was removed by the inner loop instead of the outer - NEW: users have now access to the
familyof anIteratingSystem - NEW:
familynow also contains aconfigureEntityfunction which allows users to modify an entity outside of a system in a convenient way - NEW: a new
FamilyListenersupport is added which allows users to react on when an entity is added to, or removed from afamily
ReadMe is updated as well. You can find examples for the new Family and FamilyListener functionality at the end before the Performance section.
Enjoy!