Okay so.. i have a method that basically checks if the player can buy the field and if he can then sets him as the owner and return true. the method i am referring to is buyFieldFromBank in the if statement.
But i want to check if my method returns true, and if it do, ask the user if he wants to buy it. can i actually do it like this? or will the code allready have set him as owner in the if statement? Or does it only "check" if it turns true, without actually executing the code?
if(landRegistry.buyFieldFromBank(currentPlayer, newPosID)==true){
if(GUI.getUserButtonPressed(currentPlayer.getName() + ", vil du købe " + newPosition.getFieldName() + "Ja", "Nej")=="Ja"){
landRegistry.buyFieldFromBank(currentPlayer, newPosID);