Esempio n. 1
0
        public void Deserialize(XElement serializedData)
        {
            Serializer serializer = new Serializer(serializedData);

            _settings = serializer.GetDataItem <PhoneSettings>("config-settings");

            _hasRated = serializer.GetDataItem <bool>("has-rated");

            if (serializedData.Elements("dataitem").Any(x => x.Attribute("name").Value == "reminder-plays"))
            {
                _playsBeforeNextReminder = serializer.GetDataItem <int>("reminder-plays");
            }
            else
            {
                _playsBeforeNextReminder = Initial_Plays_Before_Rating_Reminder;
            }
            _nextReminderDate    = serializer.GetDataItem <DateTime>("next-reminder");
            _livesElementAdded   = serializer.GetDataItem <bool>("lives-added");
            _livesRemaining      = serializer.GetDataItem <int>("lives-remaining");
            _lastLivesUpdateTime = serializer.GetDataItem <DateTime>("lives-updated");
            _goldenTicketCount   = serializer.GetDataItem <int>("golden-tickets");
            _currentArea         = serializer.GetDataItem <string>("last-area");

            LoadAreaDataFromXml(serializer.GetDataElement("survival-area-data"));
            LoadAvatarComponentDataFromXml(serializer.GetDataElement("avatar-component-data"));
        }
Esempio n. 2
0
        public Profile()
        {
            _areaLevelData = new Dictionary <string, AreaDataContainer>();
            _settings      = new PhoneSettings();

            _nextReminderDate = new DateTime();
            _hasRated         = false;

            _livesRemaining           = 0;
            _lastLivesUpdateTime      = new DateTime();
            _goldenTicketCount        = 0;
            _newlyUnlockedItems       = new List <XElement>();
            _unlockedAvatarComponents = new List <XElement>();
        }