Пример #1
0
 public override void LoadDefaults()
 {
     GeneratorAchievments.Clear();
     CompletedAchievments.Clear();
     AchievmentPoints = 0;
     IsLoaded         = true;
 }
Пример #2
0
 public override void ResetByPlanets()
 {
     GeneratorAchievments.Clear();
     //Badges.Clear();
     AchievmentPoints = 0;
     IsLoaded         = true;
 }
Пример #3
0
        public override void LoadSave(object obj)
        {
            AchievmentServiceSave save = obj as AchievmentServiceSave;

            if (save != null)
            {
                if (save.generatorAchievments != null)
                {
                    GeneratorAchievments.Clear();
                    foreach (var kvp in save.generatorAchievments)
                    {
                        GeneratorAchievments.Add(kvp.Key, new GeneratorAchievmentCollection(kvp.Value));
                    }

                    CompletedAchievments.Clear();
                    if (save.completedAchievments != null)
                    {
                        CompletedAchievments.AddRange(save.completedAchievments);
                    }

                    //Badges.Clear();
                    //if(save.badges != null ) {
                    //    Badges.AddRange(save.badges);
                    //}

                    this.AchievmentPoints = save.achievmentPoints;

                    IsLoaded = true;
                }
                else
                {
                    LoadDefaults();
                }
            }
            else
            {
                LoadDefaults();
            }
        }