Closed seancl closed 7 years ago
Hmm, I just realized that this makes the implicit assumption that a room / creep / flag / spawn will be storing an object in its memory slot. It's technically possible to save anything in the memory - that is, Game.spawns.Spawn1.memory = 5;
appears to be totally valid. I'm open to other ideas on how to allow the user to apply an interface to the default memory objects.
Hey! Sorry I'm being swarmed this week. I'm gonna take a look at this asap!
After taking another look at this I've made a few minor changes:
I would like to get input on whether to add a union to {}
wherever the type is used, to show that the memory can always be an empty object. This would probably result in needing to null check any value pulled from memory, which could be obnoxious, but is technically true. I am leaning toward not doing this, and instead allowing people to decide for themselves if they should make all members of the interface optional (to force null checking) or not.
Closed due to being out of date. We will likely replace these with completely empty interfaces that can be extended in user code through interface merging, rather than keeping the any
lines. Users can declare their own memory layout, as we're moving away from Any typing as much as possible.
Fixes issue #60 . Feedback welcome!