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

SingletonPlugin won't throw exception in strict mode if no system uses the component #143

Open
acanthite1855 opened this issue Dec 23, 2020 · 0 comments

Comments

@acanthite1855
Copy link

The doc states, that SingletonPlugin throws exception when an entity enters the world with a @Singleton component.

I made a singleton component, but have not yet added systems that use it (e.g. that want to inject the component into the field). Then I tried to create an entity with the component. I expected it to throw exception, but it worked fine. Here is a kotlin snippet:

@Singleton
class GameMapComponent {
    private val map: GameMap
}

// ...
world = World(WorldConfigurationBuilder()
	.with(SingletonPlugin()) // no other systems added
	.build())

val entity = world.create()
val mapComponent = world
   .getMapper(GameMapComponent::class.java)
   .create(entity)
@acanthite1855 acanthite1855 changed the title SingletonPlugin won't throw exception in strict mode if no system injects the component SingletonPlugin won't throw exception in strict mode if no system uses the component Dec 23, 2020
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

1 participant