mirror of
https://github.com/lisk77/comet.git
synced 2025-10-24 13:58:49 +00:00
fix: finally removed the storage.rsin the comet_ecs
This commit is contained in:
parent
7b6ccbe72c
commit
cae678747f
8 changed files with 45 additions and 10 deletions
|
|
@ -1,5 +1,5 @@
|
|||
use std::collections::HashMap;
|
||||
use crate::ComponentSet;
|
||||
use comet_structs::ComponentSet;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Archetypes {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
pub use storage::*;
|
||||
pub use entity::*;
|
||||
pub use component::*;
|
||||
pub use world::*;
|
||||
|
|
@ -6,7 +5,6 @@ pub use id::*;
|
|||
pub use component_derive::*;
|
||||
pub use comet_math as math;
|
||||
|
||||
mod storage;
|
||||
mod entity;
|
||||
mod component;
|
||||
mod world;
|
||||
|
|
|
|||
|
|
@ -6,11 +6,10 @@ use crate::{
|
|||
Transform2D,
|
||||
Transform3D,
|
||||
IdQueue,
|
||||
Archetypes,
|
||||
ComponentSet
|
||||
};
|
||||
use comet_log::*;
|
||||
use comet_structs::*;
|
||||
use crate::archetypes::Archetypes;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct World {
|
||||
|
|
@ -206,10 +205,10 @@ impl World {
|
|||
|
||||
/// Returns a list of entities that have the given components.
|
||||
pub fn get_entities_with(&self, components: ComponentSet) -> Vec<u32> {
|
||||
error!("The given components {:?} are not registered in the world!", components);
|
||||
if self.archetypes.contains_archetype(&components) {
|
||||
return self.archetypes.get_archetype(&components).unwrap().clone();
|
||||
}
|
||||
error!("The given components {:?} are not registered in the world!", components);
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue