NateTheGreatt/bitECS

Question: Wouldn't this refactor be better?

ceoshikhar opened this issue · 6 comments

I was reading the code and there is this function in Entity.js

let resizeThreshold = () => globalSize - (globalSize / 5)

and I was thinking that wouldn't it be better if it was changed to

const getResizeThreshold = () => globalSize - (globalSize / 5)

so that it's more consistent with other functions like getEntityCursor, getRemovedEntities, getGlobalSize etc. Maybe there is reason why you did it the way it's done but while reading the code, I just thought it looked a little weird. Maybe I am wrong.

BTW If you do agree that this change would be better then please let me do this change. I would love to be a contributor.

yea that is a better name for sure. however, all of this will be changing soon. instead of having a global memory, i have been adding in the concept of a Universe which will represent separate memory spaces, each universe having its own resizeThreshold and own set of worlds, etc. still hashing out all the details though

Got it. So I guess I won't be getting to have the pleasure of being a contributor to bitECS anytime soon. Thanks for the quick response. 😀

grorp commented

Will you have to register components not global but for universes then?

Will you have to register components not global but for universes then?

components are registered per-world. i am still pondering how to access these different memory spaces from universes. may have to add in a getComponent(universe, Component) or something similar

grorp commented

OK, thank you.