Removed static fields in Game state.
Mostly merged from #8 (72e8a7e). Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -75,8 +75,6 @@ public class GameRanking extends BasicGameState {
|
||||
this.game = game;
|
||||
this.input = container.getInput();
|
||||
|
||||
score = Game.getGameScore();
|
||||
|
||||
int width = container.getWidth();
|
||||
int height = container.getHeight();
|
||||
|
||||
@@ -170,7 +168,7 @@ public class GameRanking extends BasicGameState {
|
||||
if (retryButton.contains(x, y)) {
|
||||
OsuFile osu = MusicController.getOsuFile();
|
||||
Display.setTitle(String.format("%s - %s", game.getTitle(), osu.toString()));
|
||||
Game.setRestart(Game.RESTART_MANUAL);
|
||||
((Game) game.getState(Opsu.STATE_GAME)).setRestart(Game.RESTART_MANUAL);
|
||||
SoundController.playSound(SoundEffect.MENUHIT);
|
||||
game.enterState(Opsu.STATE_GAME, new FadeOutTransition(Color.black), new FadeInTransition(Color.black));
|
||||
} else if (exitButton.contains(x, y)) {
|
||||
@@ -192,4 +190,12 @@ public class GameRanking extends BasicGameState {
|
||||
Utils.getBackButton().setScale(1f);
|
||||
SoundController.playSound(SoundEffect.APPLAUSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the associated GameScore object.
|
||||
* @param score the GameScore
|
||||
*/
|
||||
public void setGameScore(GameScore score) {
|
||||
this.score = score;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user