I'm making a first person dungeon crawler like Eye of the Beholder.
During execution, I have a Map object. It contains Cell objects. Anc each Cell contains, at most, four Wall objects.
The Wall object has data for it's texture, and special elements like a door, a switch, etc. But most walls will end up being empty, boring walls.
My idea is to make this "boring wall" a single instance, that is referenced by all the cells that need it. Is there any design pattern or recipe in how to work with this? Or do you have any ideas?
I would like the entity's usability to be the same as the remaining entities (although I realise the default instance must be immutable).
I don't know if it helps, but I'm working with Lua.
Thanks in advance.