SampSharp
SampSharp copied to clipboard
Add component tuple arguments for events in ECS
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.