Skip to content
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

Merged
merged 2 commits into from
Aug 27, 2023

Conversation

keytsai
Copy link
Collaborator

@keytsai keytsai commented Jul 9, 2023

#81

  1. Landmark 的 CardSide 屬性改為 flipped (boolean)
  2. ownedEstablishment 重新命名為 establishments
  3. ownedLandmark 重新命名為 landmarks

1. Change CardSide attribute to flipped (boolean)
2. Rename from ownedEstablishment to establishments
3. Rename from ownedLandmark to landmarks
@shmily7829 shmily7829 self-requested a review July 11, 2023 02:30
Copy link
Collaborator

@shmily7829 shmily7829 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done.

@@ -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();
Copy link
Collaborator

@shmily7829 shmily7829 Jul 11, 2023

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());

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

}

@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);
Copy link
Collaborator

@shmily7829 shmily7829 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

getLandmarks(2)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 18 to 20
var cropCardCount = (int) getOwner().getEstablishments().stream()
.filter(establishment -> establishment.getCardType().equals(CardType.CROP))
.count();
Copy link
Collaborator

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@shmily7829 shmily7829 added the enhancement New feature or request label Jul 11, 2023
Copy link
Collaborator

@shmily7829 shmily7829 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@keytsai keytsai merged commit e478aa8 into main Aug 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants