I'm developing a simple game where the user can select a card, and then he has to select the parameters needed by that card.
For Example: I want to use a card, I select it and then I select the parameters needed by that card (another player to decrease his points).
I have created an EventHandler with FXML for the selected card (it's a simple button):
@FXML
private void selectedCard(ActionEvent event){
System.out.print("Card selected!");
//Wait here to get the parameters
//Code using those parameters
}
and another EventHandler for the player selected (which is also a simple button):
@FXML
private void selectedPlayer(ActionEvent event){
System.out.print("Player selected!");
idPlayer = event.getSource.getId();
}
I would like to wait the user to select the player and then keep going with the code inside selectedCard, how can i do that?