From 6e7abf273d758bf15c1ba3e331e370b2bea3f8e2 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 13 Sep 2025 19:24:29 +0200 Subject: feat(ecs): re-implement component added & removed events --- ecs/src/event/component.rs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'ecs/src/event') diff --git a/ecs/src/event/component.rs b/ecs/src/event/component.rs index 421c369..e8b9559 100644 --- a/ecs/src/event/component.rs +++ b/ecs/src/event/component.rs @@ -4,19 +4,17 @@ use std::convert::Infallible; use crate::Component; -// TODO: Implement -// /// Pair relation for events emitted when: -// /// a) A entity with the target component is spawned. -// /// b) The target component is added to a entity. -// #[derive(Debug, Component)] -// pub struct Added(Infallible); +/// Pair relation for events emitted when: +/// a) A entity with the target component is spawned. +/// b) The target component is added to a entity. +#[derive(Debug, Component)] +pub struct Added(Infallible); -// TODO: Implement -// /// Pair relation for events emitted when: -// /// a) The target component is removed from a entity. -// /// b) A entity with the target component is despawned. -// #[derive(Debug, Component)] -// pub struct Removed(Infallible); +/// Pair relation for events emitted when: +/// a) The target component is removed from a entity. +/// b) A entity with the target component is despawned. +#[derive(Debug, Component)] +pub struct Removed(Infallible); #[derive(Debug, Component)] pub struct Changed(Infallible); -- cgit v1.2.3-18-g5258