Closed liusida closed 2 years ago
Each chunk we iterate on can only be one kind of archetype, so checking for the presence at all like this is okay. I suppose it would be smarter to check before we enter the loop instead of every entity. :P
Each chunk we iterate on can only be one kind of archetype
Aha! I didn't know this! Thanks for the answer!
First, I want to thank you for this great demo. I'm learning a lot from it.
When I was reading README.md, I noticed there's a code snippet like this:
I was thinking, say, if we have a chunk of
5
entities, and3
of them has the optional fragment. When we loop i from0
to5-1
, we will have time wheni==4
when we face the if conditionif(OptionalFragmentList.Num() > 0)
, and since we have 3 entities with optional fragment, this will be3>0
, and we will executeOptionalFragmentList[i].DoOptionalStuff();
. ButOptionalFragmentList
only has 3 members, soOptionalFragmentList [4]
would cause error.