public static int GetLives() { int lives = 0; ScoreManager scoreMan = ScoreManager.GetInstance(); if (GetCurrentPlayer() == CurrentPlayer.Player1) { lives = GetScore(ScoreType.Player1Lives); } else { lives = GetScore(ScoreType.Player2Lives); } return(lives); }
public static void UpdateCurrentPlayerScore(int value) { ScoreManager scoreMan = ScoreManager.GetInstance(); CurrentPlayer player = GetCurrentPlayer(); if (player == CurrentPlayer.Player1) { scoreMan.player1Score += value; } else if (player == CurrentPlayer.Player2) { scoreMan.player2Score += value; } else { Debug.Assert(false); } }
public static void OneUp() { ScoreManager scoreMan = ScoreManager.GetInstance(); CurrentPlayer player = GetCurrentPlayer(); if (player == CurrentPlayer.Player1) { scoreMan.player1Lives += 1; } else if (player == CurrentPlayer.Player2) { scoreMan.player2Lives += 1; } else { Debug.Assert(false); } }
public static int UpdateLives() { int currentLives = 0; ScoreManager scoreMan = ScoreManager.GetInstance(); CurrentPlayer player = GetCurrentPlayer(); if (player == CurrentPlayer.Player1) { scoreMan.player1Lives -= 1; currentLives = scoreMan.player1Lives; } else if (player == CurrentPlayer.Player2) { scoreMan.player2Lives -= 1; currentLives = scoreMan.player2Lives; } else { Debug.Assert(false); } return(currentLives); }
public static int GetScore(ScoreType type) { int score = 0; ScoreManager scoreMan = ScoreManager.GetInstance(); switch (type) { case ScoreType.Player1Score: score = scoreMan.player1Score; break; case ScoreType.Player2Score: score = scoreMan.player2Score; break; case ScoreType.HiScore: score = scoreMan.hiScore; break; case ScoreType.Player1Lives: score = scoreMan.player1Lives; break; case ScoreType.Player2Lives: score = scoreMan.player2Lives; break; case ScoreType.Credits: score = scoreMan.credits; break; default: Debug.Assert(false); break; } return(score); }
public static void SetCurrentPlayer(CurrentPlayer newPlayer) { ScoreManager scoreMan = ScoreManager.GetInstance(); scoreMan.currentPlayer = newPlayer; }
public static CurrentPlayer GetCurrentPlayer() { ScoreManager scoreMan = ScoreManager.GetInstance(); return(scoreMan.currentPlayer); }