Пример #1
0
        public void Reset()
        {
            if (ContentToUnlockOnCompletion != null)
            {
                foreach (XElement el in ContentToUnlockOnCompletion.Elements("unlockable"))
                {
                    if (el.Attribute("type").Value == "golden-ticket")
                    {
                        el.SetAttributeValue("unlocked", false);
                    }
                }
            }

            LevelScores.Clear();

            for (int i = 0; i < LevelRanks.Count; i++)
            {
                LevelRanks[i] = Definitions.SurvivalRank.NotSet;
            }

            _worldPositionsOfGoldenTicketsCollectedFromOpenLevel.Clear();
            _worldPositionsOfSmashedCratesContainingGoldenTickets.Clear();

            LastSelectedLevel = 0;
        }
Пример #2
0
        public void SetCompletionUnlockables(XElement unlockables)
        {
            foreach (XElement el in unlockables.Elements("unlockable"))
            {
                el.SetAttributeValue("unlocked", Completed);

                bool found = false;
                foreach (XElement x in ContentToUnlockOnCompletion.Elements())
                {
                    if ((x.Attribute("type").Value == el.Attribute("type").Value) && (x.Attribute("name").Value == el.Attribute("name").Value))
                    {
                        found = true;
                    }
                }

                if (!found)
                {
                    ContentToUnlockOnCompletion.Add(el);
                }
            }
        }