Implement Resource Payout and Determination of the Winner #19
No reviewers
Labels
No labels
bug
ci
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SlothBusters/gruppe02-slothbusters-projekt3-catan#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/throw-dice"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changes made in this PR will add methods for paying out resources after dices were thrown. Furthermore, this PR adds a method for determining the winner of the game. The method
getWinner
will make sure to only declare the current player as a winner.Looks good apart from some minor things.
Splitting up this if in two methods would help the readability and would probably also explain what's special about 7 without having to write a comment.
Isn't here a condition missing, if the
diceValue
of the field is the rolled dice?This could be extracted into a method named
findGeneratedResources()
or similarMaybe also extract the condition checking into a separate method, depending on how difficult it gets to read.
@ -222,0 +294,4 @@
for (Player player : players) {
result.put(player.getFaction(), new ArrayList<>());
}
A player could have more than one resource too many. This should be repeated until the card count is lower or equal then MAX_CARD_IN_HAND_NO_DROP.
The condition for getting fields for the correct
diceValue
is stored here:fe0175c739/app/src/main/java/ch/zhaw/catan/SiedlerGame.java (L223)