Skip to content
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

Remove "used" parameter from inject function #54

Closed
jobe-m opened this issue Jun 12, 2022 · 3 comments
Closed

Remove "used" parameter from inject function #54

jobe-m opened this issue Jun 12, 2022 · 3 comments
Assignees
Milestone

Comments

@jobe-m
Copy link
Collaborator

jobe-m commented Jun 12, 2022

Since references to the inject objects and mappers are removed after initialization of the world and all systems we can remove this parameter again.
The idea for that parameter was that an injected object could be referenced (the first time) at a later time after initialization. But I think that it is much cleaner (how it is done now) to delete the inject object references after they where checked if they are all used.
->

fun <T : Any> inject(type: String, dependency: T, used: Boolean = false) {

@jobe-m jobe-m self-assigned this Jun 12, 2022
@jobe-m jobe-m added this to the 1.3-KMP milestone Jun 12, 2022
@Quillraven
Copy link
Owner

Quillraven commented Jun 12, 2022

I will bring in that change when I bring in the DSL to the next branch. Should be possible until ~Thursday! I will notify you when everything is ready.

edit: by the way, they also released Kotlin 1.7 but I think we should wait for the first bugfix release because I am pretty sure there are bugs in it again (as always ;) ). So let's wait for 1.71 or whatever they will call it before we upgrade. OR at least wait ~4 weeks before we upgrade.

@jobe-m
Copy link
Collaborator Author

jobe-m commented Jun 13, 2022

No problem. I am not in a hurry with the kotlin compiler. And yeah, first major versions might have still nasty bugs ;)

@Quillraven
Copy link
Owner

I will close the issue. It is part of #53

Quillraven added a commit that referenced this issue Jun 28, 2022
* update versions

- benchmark 0.4.1 -> 0.4.2
- kotlin-test 1.6.0 -> 1.6.10
- ashley 1.7.3 -> 1.7.4

* add next branch

* fix fleks benchmark system parameters

* update gradle version 7.3.3 -> 7.4.1

* convert to gradle kmp with jvm target

* make benchmarks for jvm work again

* remove unnecessary dokka tasks

* add JS target

* add native target

* Update with changes done in korge-fleks (#37)

New feature was added which makes it possible to mark an injectable as
"used". Thus Fleks will not throw exception if the injectable is not
used directly at creation of system and listener objects. Ie. that makes
it possible to use the injected objects during init functions. Default
for use is still "false" as before.

* update gradle 7.4.1 -> 7.4.2

* update Kotlin 1.6.10 -> 1.6.21 and add local SNAPSHOT publishing

* update ReadMe with 1.3 features and fix some outdated code snippets

* add missing lock file

* fix ComponentListener notification during system creation

refactor dependency settings/clearing

* add getOrNull of 1.0-JVM

* refactor system's world initialization and fix EntityListener notification during system's init block

changes from 1.0-JVM and 1.1-JVM

* integrate changes of 1.2-JVM and 1.3-JVM version

* remove used argument of inject function (#54)

* add WorldConfiguration DSL

* add missing javadoc to publication

* dokka simplification

* (#55) small fix in system documentation

* replace World cstr with world function

* fix benchmarks

* update world creation

* update version

* try windows-latest to publish KMP

* copy javadoc into jvm target

* maven publish adjustments

* refactor mapper storage from string key to KClass

avoids .simpleName calls

* update benchmark forks/warmups and add manual addRemove function

* replace LinkedHashMap with HashMap

Co-authored-by: Marko Koschak <marko.koschak@tisno.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants