Ejemplo n.º 1
0
 public void AddCompletedAchievment(string achievmentId)
 {
     if (!IsAchievmentCompleted(achievmentId))
     {
         CompletedAchievments.Add(achievmentId);
     }
 }
Ejemplo n.º 2
0
 public override void LoadDefaults()
 {
     GeneratorAchievments.Clear();
     CompletedAchievments.Clear();
     AchievmentPoints = 0;
     IsLoaded         = true;
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
0
 public bool IsAchievmentCompleted(string id)
 {
     return(CompletedAchievments.Contains(id));
 }