Skip to content

Commit

Permalink
final details before release, back butten still buggy
Browse files Browse the repository at this point in the history
  • Loading branch information
anadis504 committed Dec 1, 2020
1 parent 83e668b commit e5953dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public boolean getGameOver() {
public void timeInstance(GraphicsContext context) {
this.context = context;
Ui.back.setVisible(gameOver);
System.out.println(Ui.back);

if (gameOver) {
paintGameOver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ public void addScore(String name, int score) {
}

public VBox getScores() {
VBox list = new VBox();
VBox scorelist = new VBox();
List<Score> scores = dao.topTwenty();
int rank = 1;
if (scores.size() == 0) {
list.getChildren().add(new Label("No hightscores yet"));
scorelist.getChildren().add(new Label("No hightscores yet"));
} else {
for (Score score : scores) {
StringBuilder sb = new StringBuilder();
Expand All @@ -48,10 +48,10 @@ public VBox getScores() {
sb.append(" ");
}
sb.append(": ");
list.getChildren().add(new Label(sb.toString() + score.getScore()));
scorelist.getChildren().add(new Label(sb.toString() + score.getScore()));
}
}
return list;
return scorelist;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,12 @@ public void serviceDoesNotAddWhenScoreTooLow() {
verify(dao, times(0)).add(anyObject());
}

// @Test
// public void returnsLabelWhenAskedForScores() {
// List<Score> scores = new ArrayList<>();
// scores.add(new Score("bob", 12));
// when(dao.topTwenty()).thenReturn(scores);
// scoreService.getScores();
// verify(dao, times(1)).topTwenty();
// }
}

0 comments on commit e5953dc

Please sign in to comment.