public int GetLevelStars(string levelId) { if (SPLevelStars.ContainsKey(levelId)) { return(SPLevelStars[levelId]); } else { return(0); } }
/// <summary> /// Increases the current level stars by the given amount. /// The level stars are capped to not be bigger than maxStarsPerPlanet. /// </summary> public void IncrementCurrentStars(int amount) { if (SPLevelStars.ContainsKey(CurrentLevelId) == false) { SPLevelStars[CurrentLevelId] = 0; } SPLevelStars[CurrentLevelId] += amount; if (SPLevelStars[CurrentLevelId] > maxStarsPerLevel) { SPLevelStars[CurrentLevelId] = maxStarsPerLevel; } }