summaryrefslogtreecommitdiff
path: root/engine-ecs/src/component/storage
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-11-29 21:16:11 +0100
committerHampusM <hampus@hampusmat.com>2026-11-29 21:16:11 +0100
commit3c117bcd9455ffbcec5cd59dab37db0786e15e02 (patch)
tree0355ba259b51b3d5c9eb7c74cf395461517231fa /engine-ecs/src/component/storage
parentc416eca3cccac2c25ee395469005faca01fdb912 (diff)
feat(engine-ecs): change meaning of component name to type identifier
Diffstat (limited to 'engine-ecs/src/component/storage')
-rw-r--r--engine-ecs/src/component/storage/archetype.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/engine-ecs/src/component/storage/archetype.rs b/engine-ecs/src/component/storage/archetype.rs
index 480a1da..64ab587 100644
--- a/engine-ecs/src/component/storage/archetype.rs
+++ b/engine-ecs/src/component/storage/archetype.rs
@@ -328,28 +328,19 @@ impl Entity
pub struct EntityComponent
{
component: Lock<Box<dyn Any>>,
- name: &'static str,
}
impl EntityComponent
{
- pub fn new(component: Box<dyn Any>, component_name: &'static str) -> Self
+ pub fn new(component: Box<dyn Any>) -> Self
{
- Self {
- component: Lock::new(component, component_name),
- name: component_name,
- }
+ Self { component: Lock::new(component) }
}
pub fn component(&self) -> &Lock<Box<dyn Any>>
{
&self.component
}
-
- pub fn name(&self) -> &str
- {
- self.name
- }
}
/// Archetype ID.