From bef61b765de52d14a52c3df86f8b3766846be272 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 7 Jun 2024 19:55:47 +0200 Subject: refactor(ecs): make tuple reduce operation more generic --- ecs/src/system.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'ecs/src/system.rs') 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 TupleReduceElement for InputT +/// Component tuple reducing operation to get the parameters that takes input. +pub struct ParamWithInputFilter; + +impl TupleReduceElement + for InputT where Accumulator: TupleWith, { type Return = Accumulator::With; } +impl TupleReduceElement for () +{ + type Return = Accumulator; +} + #[derive(Debug)] pub struct ComponentRefMut<'a, ComponentT: Component> { -- cgit v1.2.3-18-g5258