-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Landmark): Change CardSide attribute to flipped (boolean) #84
Conversation
1. Change CardSide attribute to flipped (boolean) 2. Rename from ownedEstablishment to establishments 3. Rename from ownedLandmark to landmarks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
src/test/java/domain/PlayerTest.java
Outdated
@@ -56,15 +56,15 @@ void flipBackLandMark() { | |||
|
|||
//then | |||
assertThat(player.getTotalCoin()).isEqualTo(originalBalanceOfPlayer - 16); | |||
assertThat(player.getOwnedLandmark().get(2).getCardSide()).isEqualTo(Landmark.CardSide.FRONT); | |||
assertThat(player.getLandmarks().get(2).isFlipped()).isTrue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以用 assertTure
,並在getLandMarks
方法加order
參數
assertTrue(player.getLandmarks(2).isFlipped());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/test/java/domain/PlayerTest.java
Outdated
} | ||
|
||
@Test | ||
void flipFrontLandMark() { | ||
//given 玩家有正面的主題樂園 | ||
var originalBalanceOfPlayer = player.getTotalCoin(); | ||
var amusementPark = new AmusementPark(); | ||
player.getOwnedLandmark().get(2).setCardSide(Landmark.CardSide.FRONT); | ||
player.getLandmarks().get(2).setFlipped(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
getLandmarks(2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
var cropCardCount = (int) getOwner().getEstablishments().stream() | ||
.filter(establishment -> establishment.getCardType().equals(CardType.CROP)) | ||
.count(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這段看能不能把篩選邏輯封裝在 getEstablishments
getOwner().getEstablishments(CardType.CROP)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
#81
ownedEstablishment
重新命名為establishments
ownedLandmark
重新命名為landmarks