diff options
Diffstat (limited to 'ecs/src/system.rs')
-rw-r--r-- | ecs/src/system.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ecs/src/system.rs b/ecs/src/system.rs index 6846a16..47872a6 100644 --- a/ecs/src/system.rs +++ b/ecs/src/system.rs @@ -186,13 +186,22 @@ pub struct NoInitParamFlag {} /// A type which can be used as input to a [`System`]. pub trait Input: 'static {} -impl<InputT: Input, Accumulator> TupleReduceElement<Accumulator> for InputT +/// Component tuple reducing operation to get the parameters that takes input. +pub struct ParamWithInputFilter; + +impl<InputT: Input, Accumulator> TupleReduceElement<Accumulator, ParamWithInputFilter> + for InputT where Accumulator: TupleWith<Self>, { type Return = Accumulator::With; } +impl<Accumulator> TupleReduceElement<Accumulator, ParamWithInputFilter> for () +{ + type Return = Accumulator; +} + #[derive(Debug)] pub struct ComponentRefMut<'a, ComponentT: Component> { |