diff --git a/src/models/Agreement.java b/src/models/Agreement.java index 4693712..eb39ca6 100644 --- a/src/models/Agreement.java +++ b/src/models/Agreement.java @@ -118,6 +118,9 @@ public Player getFirstPlayer(){ return firstPlayer; } + // get second player + public Player getSecondPlayer() { return secondPlayer; } + // get id public String getName() { return name; } diff --git a/src/models/Game.java b/src/models/Game.java index 151d614..b2eadef 100644 --- a/src/models/Game.java +++ b/src/models/Game.java @@ -125,7 +125,7 @@ public int getPlayerNumber(){ public Agreement offerAgreement(){ for(Agreement agreement: agreements){ - if(!agreement.isOffered()){ + if(!agreement.isOffered() && (agreement.getSecondPlayer().getId() == currentPlayer)){ return agreement; } }