public class Game {
private final UserInterface ui = new UserInterface();
private final Calculator calc = new Calculator(ui);
public void start() {
System.out.println("The game has started, have fun!");
int userChoice = ui.getUserMenuOption();
System.out.println("User selected " + userChoice);
playOneRound();
}
public void playOneRound() {
calc.playOneRound();
System.out.println("Playing one round");
}
}
What I'm trying: Make the calculator object instance use the same user userinterface instance (DI).