amethyst / amethyst/specs

Consider inlcuding the entity generation in ComponentEvent

Open
#720 1 comment 3 reactions 0 assignees View on GitHub
feature-request
Dominant language
Rust
Stars
2.6k
Forks
215
PR merge metrics
No merged PRs in 30d

Description

## Description
Including the entity generation instead of just the index within the [component event](https://docs.rs/specs/0.16.1/specs/storage/enum.ComponentEvent.html) used by `FlaggedStorage`.

## Motivation
When an entity is deleted removal events are generated for its components in `FlaggedStorage`s. If another entity is created at the same index there is no way to tell if the removed components are from the old entity or the new one. When using this for network syncing the means we end up sending useless component removed events (since we can't be sure they don't apply to the new entity).

## Drawbacks
This would be a breaking change and would increase the size of `ComponentEvent`

## Unresolved questions

---
I would be happy to implement this if approved.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.