GH-7-implement-thief #31
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#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "GH-7-implement-thief"
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?
Implements the thief functionality.
The changes aren't tested yet
The logic seems pretty sound. I couldn't find any issues with it. There a few typos, though. I also added some suggestions for the test documentation.
Note: Remember to update all references to this function.
Note: Remember to update all references to this variable.
playerResources
would be more concise in my opinion.@ -21,0 +90,4 @@
// switch players so red doesn't steel from himself
model.switchToNextPlayer();
// do the actuall stealing
@ -21,0 +94,4 @@
assertTrue(model.placeThiefAndStealCard(new Point(5, 5)));
// the thief should steal one brick as this is
checkAllInventoriesEmptyExcept(model, null);
}
@ -21,0 +96,4 @@
checkAllInventoriesEmptyExcept(model, null);
}
/**
@ -21,0 +135,4 @@
*
* @param model the siedler game
* @param nonEmptyPlayer the player with a non empty inventory or null if no
* player should have an empty inventory
@ -0,0 +1,50 @@
# Test Cases
This document provides a brief explanation of the testcases.
@ -0,0 +1,50 @@
# Test Cases
This document provides a brief explanation of the testcases.
All tests are supposed to run through with the expected result successfully.
@ -0,0 +5,4 @@
## `SiedlerGameTest`
### `testPlacingThief`
This test tests if the thief can be moved. This testcase doesn't test if a card is stolen, see testStealRandomCardWhenPlacingThief() for this.
@ -0,0 +8,4 @@
This test tests if the thief can be moved. This testcase doesn't test if a card is stolen, see testStealRandomCardWhenPlacingThief() for this.
#### Equivalence Classes
1. For out of bounds coordinate, false should be returned and the thief shouldn't be moved
@ -0,0 +9,4 @@
#### Equivalence Classes
1. For out of bounds coordinate, false should be returned and the thief shouldn't be moved
2. For position, which aren't fields, false should be returned and the thief shouldn't be moved
Awesome job!
However - I have a few changes to ask for
Fix typo
@ -149,4 +149,5 @@ public class SiedlerBoardTextView extends HexBoardTextView<SiedlerField, Siedler
}
return label;
}
Unnecessary blank line
Unnecessary blank line
In my understanding, you should get one of the potential target candidates rather than any random player (I might be wrong, tho)
(If I'm correct) you should accept a parameter where you can pass the potential target candidates
@ -56,0 +60,4 @@
public void executeUntilSuccessful() {
while (!execute()) {
}
}
Awesome job, I like this solution!✨
@ -21,0 +104,4 @@
void testPaymentOfFieldWithThief() {
SiedlerGame model = ThreePlayerStandard.getAfterSetupPhase(4);
clearAllInventories(model);
// place thief on 5,5