예제 #1
0
 public LevelScore getScores(final Difficulty dclty, final int levelNo) {
   if (levelNo - 1 < scores[dclty.ordinal()].size()) {
     return scores[dclty.ordinal()].get(levelNo - 1);
   } else {
     return new LevelScore();
   }
 }
예제 #2
0
 @SuppressWarnings("unchecked")
 public UserScore() {
   maxPlayedLevel = new int[Difficulty.length()];
   scores = new ArrayList[Difficulty.length()];
   for (int i = 0; i < maxPlayedLevel.length; i++) {
     maxPlayedLevel[i] = 1;
     scores[i] = new ArrayList<LevelScore>();
     scores[i].add(new LevelScore(1, 0, 0, 0, Medals.None));
   }
 }
예제 #3
0
 public void updateScores(final Difficulty dclty, final LevelScore score) {
   final LevelScore existingScore = scores[dclty.ordinal()].get(score.getLevelNo() - 1);
   if (score.getMedalWon().ordinal() >= existingScore.getMedalWon().ordinal()) {
     scores[dclty.ordinal()].set(score.getLevelNo() - 1, score);
   }
 }
예제 #4
0
 public void addScores(final Difficulty dclty, final LevelScore score) {
   scores[dclty.ordinal()].add(score);
 }
예제 #5
0
 public void setMaxPlayedLevel(final Difficulty dclty, final int maxPlayedLevel) {
   this.maxPlayedLevel[dclty.ordinal()] = maxPlayedLevel;
 }
예제 #6
0
 public int getMaxPlayedLevel(final Difficulty dclty) {
   return maxPlayedLevel[dclty.ordinal()];
 }