/// <summary> /// Protected initial constructor, should be called at the start of the game /// </summary> /// <param name="type">The game type</param> /// <param name="lives">The number of starting lives</param> /// <param name="res">The amount of starting resources</param> protected GameScore() { WinCheck = null; TotalScoreCalc = null; resources = 0; enemiesKilled = 0; wavesCompleted = 0; livesRemaining = 0; timePlayed = 0; replay = ""; totalScore = 0.0; }
/// <summary> /// Initializes GameScore object with the starting values for the game as /// well as the functions to calculate total score to check for the win condition /// </summary> /// <param name="lives">The amount of lives the player will start with</param> /// <param name="res">The amount of resources the player will start with</param> /// <param name="strat">The strategy to be used to calculate score and check for the win condition</param> public void Initialize(int lives, int res, AbstractGameStrategy strat) { livesRemaining = lives; resources = res; WinCheck = strat.GameWon; wavesCompleted = 1; TotalScoreCalc = strat.CalcTotalScore; }