this post was submitted on 30 Jul 2023
10 points (100.0% liked)
Programming
13212 readers
1 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
No that would be crazy.
No, but seriously, the find operator is supposed to take only one type and not merge the types. ECS seems close enough to relational databases, but not that close.
In this case, would the components be combined into a list? Basically you'd have a
BubbleComponent[]
attached to the entity instead of just aBubbleComponent
? Maybe I'm misunderstanding what the system is, isclick_handler
in the post a system, and if so, do systems only declare a single component of an entity as their input? From my experience, you often want to work with multiple components of the same entity in a system, for example:Would there be a simpler way to query these components in the system, and what if I wanted to query for both
BoundaryComponent
andBubbleComponent
, what would that look like?The way I figured would make sense was that, in the engine/game itself, the BoundaryComponent would have an additional field for registered scripts or that there would be an additional component just for registered scripts, to keep components lean. Not sure if that actually worked out in reality.
Then there would be a system for clicking on boundaries that would call such a script, if available. It's probably a poor example, but since that system doesn't touch much else, only the boundary component gets passed into the script. That's not supposed to be a rule, though. I probably should clarify that on the post later on...
Yes.