amethyst / amethyst/specs

FlaggedStorage with information about the change in value.

Abierto
#638 7 comentarios 2 reacciones 0 asignados Ver en GitHub
feature-request
Lenguaje dominante
Rust
Estrellas
2.6k
Forks
215
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Description
Update flagged storage, or create a new storage, so that the ComponentEvent contains information about the component before and after the change.

* Insert contains a copy of the value inserted
* Modified has before and after
* Removed has the value after it was removed.

## Motivation
I maintain collision detection information in a resource. This needs to be kept in sync with the entities in specs.

When an entity is deleted, I need to find the handle stored on the component to identify the object in the collision information. This handle can be used to delete it from the collision world. Since the entity has already been deleted, I can't look up this information from the world.

Right now, whenever I delete an entity, I just check if it has the information and delete the collision object. This is less than ideal, since I must change every system to account for my collision detection system.

## Drawbacks

* Is it a breaking change?
If we make a new storage for this, no. If we modify FlaggedStorage, then yes.
* Can it impact performance, learnability, etc?
No, using and learning about this is optional. Changes should not affect performance of anything else.

## Unresolved questions

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.