I am working on designing a toy game project where I have characters in the game. Characters can carry items in Satchels or boxes. The boxes can carry items like gold coin, magical ring etc while Satchels can contain food item, books etc.
What design pattern can I use to provide items to players such that I can enforce certain items can only be put in Satchels and not boxes. I don't need the code, just give me some direction how I can implement such design.
Any suggestion would be highly appreciated.
Aucun commentaire:
Enregistrer un commentaire