harmboschloo / elm-ecs

Using the entity-component-system (ECS) pattern in elm.
https://package.elm-lang.org/packages/harmboschloo/elm-ecs/latest/
BSD 3-Clause "New" or "Revised" License
32 stars 0 forks source link

How would I create a selector for more than 5 components? #1

Open peacememories opened 5 years ago

peacememories commented 5 years ago

Hi, I'm trying to find out whether to use elm-ecs for an application we are developing at work. It's not so much a game as it is an application with highly composable types, so a kind of ecs seems to make sense. It could very well be though, that we will have more than 5 of these different components, so it would be nice to know whether it's theoretically possible (and ergonomic) to select more than 5 components in a selector. Of course I'm hoping we won't need selectors that big, but you never know^^

Side note: I'll totally be fine with an answer of "no, you shouldn't be doing that" ^^

harmboschloo commented 5 years ago

Definitely possible. 5 was just an initial guess on how many would be needed, and it saved me some timing from adding more 😁. However I think in general it's better to keep the number of components in a selector low. For instance by merging two components together of by splitting up system logic. But if you really need more than 5 they could be added. Also if there would be selector composion (#2) you'd have some more options 😄