diff options
author | HampusM <hampus@hampusmat.com> | 2024-12-16 14:37:27 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-12-16 15:01:36 +0100 |
commit | f19ccb4fe2efd948b3e2276679c7dc11afb0142e (patch) | |
tree | a73fcc241039f92e099d9da145f548f7fd054556 | |
parent | 0f09a8a52d72c2e91166f54136846ea3907bb776 (diff) |
fix(ecs): make World::default fn behave same as World::new fn
-rw-r--r-- | ecs/src/lib.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index 334fe69..3926344 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -55,7 +55,7 @@ pub use ecs_macros::{Component, Sole}; pub use crate::query::Query; -#[derive(Debug, Default)] +#[derive(Debug)] pub struct World { data: WorldData, @@ -68,7 +68,11 @@ impl World #[must_use] pub fn new() -> Self { - let mut world = Self::default(); + let mut world = Self { + data: WorldData::default(), + stop: AtomicBool::new(false), + is_first_tick: AtomicBool::new(false), + }; world.add_sole(Stats::default()).ok(); @@ -469,6 +473,14 @@ impl World } } +impl Default for World +{ + fn default() -> Self + { + Self::new() + } +} + /// The result of calling [`World::step`]. pub enum StepResult { |