summaryrefslogtreecommitdiff
path: root/engine-ecs/src/sole.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-11-02 03:33:04 +0100
committerHampusM <hampus@hampusmat.com>2026-11-02 03:33:04 +0100
commit790c746a35d59be5070c40d6ca1f71cc9a2d094b (patch)
treefa4e75d00099e1cc76bd4a8e67254b4b85b8dfb9 /engine-ecs/src/sole.rs
parent5f4118d38783c01d35ca0907d07edb7af30e2fbc (diff)
feat(engine-ecs): add marker component for soles
Diffstat (limited to 'engine-ecs/src/sole.rs')
-rw-r--r--engine-ecs/src/sole.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/engine-ecs/src/sole.rs b/engine-ecs/src/sole.rs
index 9168414..cf5283b 100644
--- a/engine-ecs/src/sole.rs
+++ b/engine-ecs/src/sole.rs
@@ -7,7 +7,7 @@ use crate::component::{
WithAssociatedId as ComponentWithAssociatedId,
};
use crate::system::{Metadata as SystemMetadata, Param as SystemParam};
-use crate::World;
+use crate::{Component, World};
/// A component which has a single instance in the [`World`].
pub trait Sole: Any + IntoComponentParts + ComponentWithAssociatedId
@@ -20,6 +20,11 @@ pub trait Sole: Any + IntoComponentParts + ComponentWithAssociatedId
fn name(&self) -> &'static str;
}
+/// Marker component for the entities of soles.
+#[derive(Debug, Component)]
+#[non_exhaustive]
+pub struct Is;
+
/// Holds a reference to a singleton component.
#[derive(Debug)]
pub struct Single<'world, SoleT: Sole>