public void UpdateCurrentLevelScore(int score)
 {
     while (LevelScores.Count <= LastSelectedLevel)
     {
         LevelScores.Add(0);
     }
     LevelScores[LastSelectedLevel] = score;
 }
Exemple #2
0
    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);
    }
Exemple #3
0
    /// <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);
    }
Exemple #4
0
        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;
            }
        }