Despite being a god object, if you always feel that the code you're writing is suitable for the role of BridgeConsole, then the problem is with the name! Rename it something more specific, and separate the other tasks into their respective classes. It is easier said than done, so perhaps it would be simply easier to rewrite the class from scratch. Before you do so, definitely keep a backup somewhere you can refer to!
Remove the class and then begin creating classes to perform the tasks that BridgeConsole did , but focused on the individual tasks. Some component ideas include:
- An EventBus class which only handles notifying listeners of events. In this way, you can decouple many of the things BridgeConsole does and it would allow you to easily break it down into individual components.
- Another trick you can use is to create a class which draws, or is responsible for printing the state onto the screen. It shouldn't contain any logic other than what is required to show the current state on the screen.
- A game state class (probably the most similar to your current BridgeConsole class) that only provides information related to the game state.
- If the game state class is too large, consider creating also a Board state class which keeps track of the hands, cards played, this sort of thing. The game state can instead focus on overall game state (for example, is the game started? who are the players? How many points does each player have? Who won?).
If you've applied all these changes, and you still find yourself with a class that does too much, list out all the things that it does for you, and strongly consider dividing the class into components which perform each individual item in that list, much like you did for BridgeConsole.
And, if you find yourself pulling out your hair, consider simply rewriting the entire program. It shouldnt' take you as long because you've already written it, plus you have working code to boot. It would also teach you a valuable lesson on how to structure your code better. The fact that you realize the problem with BridgeConsole only means you've grown as a developer since you've first made it, so your second attempt should surely fix many of the issues.
I hope that helps. If you run into any difficulties, please mention them in the comments and I'll try to help.