Esempio n. 1
0
        public void SaveUserLevelProgress()
        {
            SaveAndResetSecondsSpent();

            LevelProgress userProgress = CollectUserProgress();
            string        jsonData     = JsonConvert.SerializeObject(userProgress);

            var request = new Request {
                method     = HttpMethod.POST,
                endpoint   = "/levels/save",
                jsonString = jsonData
            };

            ApiHandler.instance.AddRequestToQueue(request);
        }
Esempio n. 2
0
        private LevelProgress CollectUserProgress()
        {
            LevelData levelData = this.levelData[PMWrapper.currentLevel.id];

            var userProgress = new LevelProgress()
            {
                levelId       = levelData.id,
                isCompleted   = levelData.isCompleted,
                mainCode      = levelData.mainCode,
                codeLineCount = levelData.codeLineCount,
                secondsSpent  = levelData.secondsSpent
            };

            return(userProgress);
        }
        private LevelProgress CollectUserProgress()
        {
            var levelData = LevelData[PMWrapper.CurrentLevel.id];

            var userProgress = new LevelProgress()
            {
                levelId       = levelData.Id,
                isCompleted   = levelData.IsCompleted,
                mainCode      = levelData.MainCode,
                codeLineCount = levelData.CodeLineCount,
                secondsSpent  = levelData.SecondsSpent
            };

            return(userProgress);
        }