示例#1
0
        public static void SetLevelChallengeCompleted(int challengeId)
        {
            var storage = new StorageHandler();
            storage.SetChallengeCompleted(challengeId);

            for (int i = 0; i < CurrentChapter.Levels.Count; i++)
            {
                var level = CurrentChapter.Levels[i];

                if (level.Challenges != null)
                {
                    for (int j = 0; j < level.Challenges.Count; j++)
                    {
                        var challenge = level.Challenges[j];

                        if (challenge.Id == challengeId)
                        {
                            challenge.IsCompleted = true;
                            i = CurrentChapter.Levels.Count;
                            break;
                        }
                    }
                }
            }
        }
示例#2
0
文件: Level02.cs 项目: JohanGl/Moon
 public Level02()
 {
     storage = new StorageHandler();
 }
示例#3
0
        public static void UpdateLevelScore(int levelId, int score)
        {
            for (int i = 0; i < CurrentChapter.Levels.Count; i++)
            {
                var level = CurrentChapter.Levels[i];

                if (level.Id == levelId)
                {
                    if (level.Score < score)
                    {
                        level.Score = score;

                        var storage = new StorageHandler();
                        storage.SetLevelScore(levelId, score);
                    }

                    break;
                }
            }
        }