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

Add component tuple arguments for events in ECS #328

Open
ikkentim opened this issue Jan 28, 2020 · 0 comments
Open

Add component tuple arguments for events in ECS #328

ikkentim opened this issue Jan 28, 2020 · 0 comments
Labels
area-ECS Issues related to SampSharp.Entities feature
Milestone

Comments

@ikkentim
Copy link
Owner

ikkentim commented Jan 28, 2020

Currently, entity parameters in ECS can be transformed into a component of the entity by the event system, for example:

[Event]
public void OnPlayerSpawn(Player player)
{
    // ...
}

the event is currently not invoked if the component (Player) could not be found for the argument. It would be nice to select multiple components of the same entity, most likely using a tuple:

[Event]
public void OnPlayerSpawn((Player player, CitySelectionComponent citySelection), IWorldService worldService, /* ... */)
{
    // ...
}

Like with a single component, all the components in the tuple would need to exist in the entity in order for the event to be invoked.

@ikkentim ikkentim added feature area-ECS Issues related to SampSharp.Entities labels Jan 28, 2020
@ikkentim ikkentim added this to the 0.11.0 milestone Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ECS Issues related to SampSharp.Entities feature
Projects
None yet
Development

No branches or pull requests

1 participant