Count entities #1077
Unanswered
gamecoder-nz
asked this question in
Q&A
Count entities
#1077
Replies: 3 comments 2 replies
-
It depends on the set actually. Single type views have a |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ok so I would need to keep track of the count myself somehow
…On Tue, 17 Oct 2023, 9:48 pm Michele Caini, ***@***.***> wrote:
It depends on the set actually. Single type views have a size method that
returns the exact number of elements while multi-type views have a
size_hint method that return the upper bound. The only way to know the
exact number in the last case is by visiting the set instead.
—
Reply to this email directly, view it on GitHub
<#1077 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHPB7RLUMUVY4QONAP5THLX7ZA5FAVCNFSM6AAAAAA6C7DBI2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGMBRGQ2DO>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
So I have a star spawner system. If the number of stars in the game is less
than 5 then create a new one. If there are already 5 stars then move the
oldest one. In the collision detection system the star will be destroyed
if the player touches it. I want to keep the systems separate and not
communicate with each other.
I originally had the size method because I was only finding entities with a
star component but I also need to exclude another component which means a
lose the size method
…On Tue, 17 Oct 2023, 10:00 pm Michele Caini, ***@***.***> wrote:
It's hard to say. It smells of XY-problem to be honest. What's the
purpose? I really can't help without a bit of context.
—
Reply to this email directly, view it on GitHub
<#1077 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKHPB7TO6QPZDHITBWMVZDDX7ZCJHAVCNFSM6AAAAAA6C7DBI2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TGMBRGU4TM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to count the number of entities that have a given set of components?
Beta Was this translation helpful? Give feedback.
All reactions