-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleA new feature, making something new possibleS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
What problem does this solve or what need does it fill?
The following does not currently compile:
#[derive(Serialize, Deserialize, MapEntities)]
struct PlayerSaveData {
entity: Entity,
position: Vec2,
velocity: Vec2,
}
#[derive(Serialize, Deserialize, MapEntities)]
struct PlayerSaveStage(#[entities] Vec<PlayerSaveData>);
The problem is that Vec<PlayerSaveData>
does not implement MapEntities. Vec<Entity>
does however. This means I have to manually implement MapEntities
for PlayerSaveStage
even though it's incredibly trivial.
What solution would you like?
Implement MapEntities
for Vec<T>
where T: MapEntities
. This should automatically work for Entity since Entity: MapEntities
.
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 possibleS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!