Beispiel #1
0
 public void saveGameScore()
 {
     if (this.game_mode == GameMode.SINGLE_PLAYER)
     {
         if (this.playerA.score > 0)
         {
             ScoreDAO scoreDAO = new ScoreDAO();
             scoreDAO.create(new ScoreDTO(this.playerA.id, this.playerA.score, this.difficulty, this.game_mode));
         }
     }
     else if (this.game_mode == GameMode.MULTI_PLAYER_STANDALONE)
     {
         ScoreDAO scoreDAO = new ScoreDAO();
         if (this.playerA.score > 0)
         {
             scoreDAO.create(new ScoreDTO(this.playerA.id, this.playerA.score, this.difficulty, this.game_mode));
         }
         if (this.playerB.score > 0)
         {
             scoreDAO.create(new ScoreDTO(this.playerB.id, this.playerB.score, this.difficulty, this.game_mode));
         }
     }
 }
Beispiel #2
0
 public void saveScore()
 {
     if (Game.current_game.game_mode == GameMode.SINGLE_PLAYER)
     {
         ScoreDAO scoreDAO = new ScoreDAO();
         scoreDAO.create(new ScoreDTO(this.id, this.score, Game.current_game.difficulty, Game.current_game.game_mode));
     }
 }