Back to project page spacegunner.
The source code is released under:
MIT License
If you think the Android project spacegunner listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.spacegunner.gameresult; /*from www. j av a2 s .c om*/ import com.example.spacegunner.ioservice.PlayerHighscore; public class GameResultPresenterImpl implements GameResultPresenter { private GameResultView view; private GameResultModel model; public GameResultPresenterImpl(GameResultView view, int points) { super(); this.model = new GameResultModelImpl(points); this.view = view; checkForHighscore(); } private void checkForHighscore() { final PlayerHighscore playerHighscore = this.view.readHighscore(); final int currentPoints = this.model.getPoints(); if (currentPoints < playerHighscore.getHighscore()) { this.view.hideSaveHighscoreLayout(); } } @Override public void saveHighscoreButtonClicked(final String playerName) { PlayerHighscore playerHighscore = new PlayerHighscore(playerName, this.model.getPoints()); this.view.saveHighscore(playerHighscore); this.view.showHighscoreSavedToast(); this.view.startMainView(); } @Override public void buttonReturnMainViewClicked() { this.view.startMainView(); } @Override public void backButtonPressed() { this.view.startMainView(); } }