I am doing a global libgdx strategy, how can I properly design the architecture? So far, I'm in some kind of chaos, because there are different events that need to be shown to the player in the form of widgets.
For example, one problem is that I need to understand how the Province class will display a message that there is a hunger problem. Should it:
- immediately inside itself display a message?
- send event data to the main class of the game, which processes the data and, depending on the event, display the message or take some other action?
- do something else entirely?
I had the idea to make a separate class of events and so that all game objects create this object and pass it to the main class of the game, which handles them and decides what to do with it, and if necessary, pass it to the players.
And I read about the fact that there is a class
java.util.EventObject. Is it worth implementing it with the help of it, or should it be implemented like that yourself? Or maybe it should be done in a completely different way?
The game is turn-based. There are separate provinces and the units move from one province to the neighboring one in 1 turn.
At the beginning of each turn, a series of windows appear in turn, notifying of certain events, for example, famine in a province or enemy troops attacked a province, etc.
There are classes of the province, the player, various UI - windows, which display information about events.