Beispiel #1
0
        public static GameLevel GetCurrentLevel(this GameProgress progress)
        {
            var currentChapter = progress.GetCurrentChapter();

            if (currentChapter == null)
            {
                return(null);
            }
            if (progress.CurrentLevelIndex >= currentChapter.Levels.Count)
            {
                return(null);
            }

            return(currentChapter.Levels[progress.CurrentLevelIndex]);
        }
Beispiel #2
0
 public static GameChapter GetCurrentChapter(this GameProgress progress)
 {
     return(progress.CurrentChapterIndex < progress.Chapters.Count
                         ? progress.Chapters[progress.CurrentChapterIndex]
                         : null);
 }