public void UpdateCurrentLevelScore(int score) { while (LevelScores.Count <= LastSelectedLevel) { LevelScores.Add(0); } LevelScores[LastSelectedLevel] = score; }
public LevelScore GetScoreByBoardId(string boardId) { LevelScore score = LevelScores.Find(p => { return(p.LeardBoardID == boardId); }); if (score == null) { score = new LevelScore(GameGlobalValue.GetLevelIdByBoardId(boardId)); score.LeardBoardID = boardId; LevelScores.Add(score); } return(score); }
/// <summary> /// 获得游戏场景的纪录 /// </summary> /// <param name="level"></param> /// <returns></returns> public LevelScore GetScoreByLevel(int level) { LevelScore score = LevelScores.Find(p => { return(p.LevelID == level); }); if (score == null) { score = new LevelScore(level); score.LeardBoardID = GameGlobalValue.GetBoardIdByLevel(level); LevelScores.Add(score); } return(score); }
public void UpdateCurrentLevelResults(int score, Definitions.SurvivalRank rank) { while (LevelScores.Count <= LastSelectedLevel) { LevelScores.Add(0); } LevelScores[LastSelectedLevel] = score; while (LevelRanks.Count <= LastSelectedLevel) { LevelRanks.Add(Definitions.SurvivalRank.NotSet); } if ((LevelRanks[LastSelectedLevel] == Definitions.SurvivalRank.NotSet) || ((int)LevelRanks[LastSelectedLevel] > (int)rank)) { LevelRanks[LastSelectedLevel] = rank; } }