private GameInfoDto CreateGameInfo() { var exclusions = _exclusionStore.GetAll(); var dto = new GameInfoDto() { task_points = 3, task_coins = 30, task_times = new[] { 6, 6 }, personal_life_click_reduce = 3, personal_life_increase_time = 2, courses = new[] { new CourseDto { number = 1, points_to_next = 25 }, new CourseDto { number = 2, points_to_next = 50 }, new CourseDto { number = 3, points_to_next = 60 }, new CourseDto { number = 4, points_to_next = 75 }, new CourseDto { number = 5, points_to_next = 100 }, new CourseDto { number = 6, points_to_next = 200 }, }, abilities = new AbilityDto[] { new AbilityDto() { id = 1, name = "Increase max private life by 20", price = 300 }, new AbilityDto() { id = 2, name = "Increase tasks capacity by 10", price = 300 }, }, reasons = new ReasonDto[exclusions.Count] }; for (int i = 0; i < exclusions.Count; i++) { var exclusion = exclusions[i]; dto.reasons[i] = new ReasonDto { Description = exclusion.Title, Name = exclusion.Description, Id = exclusion.Id }; } return(dto); }
private void SetData() { if (!_appStateHandler.GetData(out GameInfoDto dto)) { if (_localDataProvider.Exist <GameInfoDto>()) { dto = _localDataProvider.Load <GameInfoDto>(); } else { dto = CreateGameInfo(); _localDataProvider.Save(dto); } } //else //{ dto = CreateGameInfo(); //} _gameInfoDto = dto; }