-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-BlockedThis cannot move forward until something else changesThis cannot move forward until something else changesX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon
Description
What problem does this solve or what need does it fill?
There may be times where we want a Resource to store an entity where it would not make sense to do so for components.
// It wouldn't make sense for this to be a component as there can only be one.
#[derive(Resource)]
pub struct CurrentPlayer(Entity);
pub struct Player;
Currently there is no way to ensure that the entity is valid such as in the case of Component relationships.
What solution would you like?
Allow resources to be specified in relationships
#[derive(Resource)]
#[relationship_target(relationship = Player)]
pub struct CurrentPlayer(Entity);
#[derive(Component)]
#[relationship(relationship_target = CurrentPlayer)]
pub struct Player(Entity);
What alternative(s) have you considered?
Same as before but check if the entity is valid each time it is used.
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-BlockedThis cannot move forward until something else changesThis cannot move forward until something else changesX-UncontroversialThis work is generally agreed uponThis work is generally agreed upon