Skip to content

Add component tuple arguments for events in ECS #328

Open
@ikkentim

Description

@ikkentim

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-ECSIssues related to SampSharp.Entitiesfeature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions