I'm currently creating a simple console-based game in which the player can move between different rooms, pick up and use items, and eat food. In the game's current state that's about it.
What I need help with is:
Creating a good "Event" class for my game. The way I'd like it to work is that every item and room should be able to be associated with an Event.
As I'm new to this I'd appreciate any reading material related to this kind of procedure, or suggestions as to how it would be best to set up my class(es) considering the points below, or simply how to attack this kind of problem (that is having trouble deciding how to set up classes).
I want to be able to create different kinds of events, for example:
Output some text, and then ask the player a question. If the player gives the correct answer, do something.
Output some text, then remove an item from the player's inventory, and then move the player to another room.
What I'm trying to avoid:
The entire point of the game is to practice good class design, so things such as responsibility-driven design, cohesion and coupling are important aspects. Thus I want it to be as simple, reusable and independent as possible.
Having to hard-code every event so that an item or room simply calls a specific method in the Event class.
What I'm thinking at the moment:
Creating a few sub-classes so that I could for example create new events (and associate them) using: itemObject.setEvent(new Event(new Question("introText", "outroText", "correctAnswer")));
Please let me know if more info is needed! Thanks!