I hope this a correct stack.
I am developing a nethack-like game, and I would like an advice how to approach the design part. For now I got class like Location, Npc, Item etc. But I ve got a problem how to easily access parts of location.
Lets say I have an object Door inside (not inheritated). If player is inside location it is easy to check whether door are opened. But on the other hand (I got this solution with my previous non-object implementation) I had a script that at 0600 opened all shops. But now I need to iterate thru all lcoations, check whethere are doors inside, and open them if location is a shop. Is it really optimized way to do it?
I could also do a globals (like singelton) with door states and fastly run thru those - but it would be hardly an OOP.
What are the possibilites here?
If this problem is somewhere covered please share link with me and that would surely be enough :)
Thanks!
Zaqqen