From 0f09a8a52d72c2e91166f54136846ea3907bb776 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 13 Dec 2024 17:28:02 +0100 Subject: refactor(ecs): remove system::Param associated type Flags --- ecs/src/actions.rs | 3 +-- ecs/src/component/local.rs | 1 - ecs/src/query.rs | 7 +------ ecs/src/sole.rs | 3 +-- ecs/src/system.rs | 5 +---- 5 files changed, 4 insertions(+), 15 deletions(-) (limited to 'ecs') diff --git a/ecs/src/actions.rs b/ecs/src/actions.rs index 1ed49a8..babd5a2 100644 --- a/ecs/src/actions.rs +++ b/ecs/src/actions.rs @@ -6,7 +6,7 @@ use crate::component::{ Metadata as ComponentMetadata, Sequence as ComponentSequence, }; -use crate::system::{NoInitParamFlag, Param as SystemParam, System}; +use crate::system::{Param as SystemParam, System}; use crate::uid::{Kind as UidKind, Uid}; use crate::{ActionQueue, World}; @@ -94,7 +94,6 @@ impl<'world> Actions<'world> impl<'world> SystemParam<'world> for Actions<'world> { - type Flags = NoInitParamFlag; type Input = (); fn initialize( diff --git a/ecs/src/component/local.rs b/ecs/src/component/local.rs index aac4255..ad79f6f 100644 --- a/ecs/src/component/local.rs +++ b/ecs/src/component/local.rs @@ -15,7 +15,6 @@ impl<'world, LocalComponent> SystemParam<'world> for Local<'world, LocalComponen where LocalComponent: Component, { - type Flags = (); type Input = LocalComponent; fn initialize( diff --git a/ecs/src/query.rs b/ecs/src/query.rs index 0a9eca1..aa424e5 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -15,11 +15,7 @@ use crate::component::{ }; use crate::lock::{ReadGuard, WriteGuard}; use crate::query::options::Options; -use crate::system::{ - NoInitParamFlag as NoInitSystemParamFlag, - Param as SystemParam, - System, -}; +use crate::system::{Param as SystemParam, System}; use crate::uid::Uid; use crate::{EntityComponent, World}; @@ -161,7 +157,6 @@ where Comps: ComponentSequence, OptionsT: Options, { - type Flags = NoInitSystemParamFlag; type Input = (); fn initialize( diff --git a/ecs/src/sole.rs b/ecs/src/sole.rs index b7c9a68..a35b520 100644 --- a/ecs/src/sole.rs +++ b/ecs/src/sole.rs @@ -5,7 +5,7 @@ use std::ops::{Deref, DerefMut}; use std::sync::{Arc, Weak}; use crate::lock::{Lock, WriteGuard}; -use crate::system::{NoInitParamFlag, Param as SystemParam, System}; +use crate::system::{Param as SystemParam, System}; use crate::type_name::TypeName; use crate::World; @@ -92,7 +92,6 @@ impl<'world, SoleT> SystemParam<'world> for Single<'world, SoleT> where SoleT: Sole, { - type Flags = NoInitParamFlag; type Input = (); fn initialize( diff --git a/ecs/src/system.rs b/ecs/src/system.rs index f266095..992fd69 100644 --- a/ecs/src/system.rs +++ b/ecs/src/system.rs @@ -49,7 +49,7 @@ macro_rules! impl_system { for Func where Func: Fn(#(TParam~I,)*) + Copy + RefUnwindSafe + UnwindSafe + 'static, - #(TParam~I: Param<'world, Flags = NoInitParamFlag>,)* + #(TParam~I: Param<'world, Input = ()>,)* { type Input = Infallible; @@ -156,7 +156,6 @@ type TypeErasedRunFn = dyn Fn(&dyn Any, &World) + RefUnwindSafe + UnwindSafe; pub trait Param<'world> { type Input; - type Flags; fn initialize( system: &mut impl System<'world, SystemImpl>, @@ -169,8 +168,6 @@ pub trait Param<'world> ) -> Self; } -pub struct NoInitParamFlag {} - /// A type which can be used as input to a [`System`]. pub trait Input: 'static {} -- cgit v1.2.3-18-g5258