Exemple #1
0
        public GameVM(AmfFile file, GameVM previousVM)
            : base(file)
        {
            SetCharacterOptions();
            setCharacter("PC");
            SaveFile = new AmfObjectVM(file);

            var flagsObject = FlagsObject;

            _flags = new GeneralObjectVM(flagsObject);
            if (null != previousVM)
            {
                _searchText = previousVM._searchText;
            }

            // Flags
            foreach (var xmlFlag in XmlData.Current.Flags)
            {
                if (!_allFlags.ContainsKey(xmlFlag.Name))
                {
                    _allFlags[xmlFlag.Name] = new FlagVM(this, ref flagsObject, xmlFlag);
                }
            }
            foreach (var flag in flagsObject)
            {
                string flagName = flag.ToString();
                if (!_allFlags.ContainsKey(flagName))
                {
                    XmlEnum data = new XmlEnum();
                    data.Name           = flagName;
                    _allFlags[flagName] = new FlagVM(this, ref flagsObject, data);
                }
            }
            Flags = new UpdatableCollection <FlagVM>(_allFlags.Values.ToList().Where(x => x.Match(SearchText)));
        }
Exemple #2
0
        public GameVM(AmfFile file, GameVM previousVM)
            : base(file)
        {
            SetCharacterOptions();
            setCharacter("PC");

            _flags = new GeneralObjectVM(GetObj("flags"));

            // Perks
            var charPerks = Character.GetObj("perks");

            if (null == charPerks)
            {
                charPerks = new Model.AmfObject(AmfTypes.Array);
            }
            var xmlPerks         = XmlData.Current.PerkGroups.SelectMany(x => x.Perks).ToArray();
            var unknownPerkGroup = XmlData.Current.PerkGroups.Last();

            ImportMissingNamedVectors(charPerks, xmlPerks, "storageName", x => x.GetString("tooltip"), unknownPerkGroup.Perks);

            PerkGroups = new List <PerkGroupVM>();
            foreach (var xmlGroup in XmlData.Current.PerkGroups)
            {
                var perksVM = xmlGroup.Perks.OrderBy(x => x.Name).Select(x => new PerkVectorVM(this, charPerks, x)).ToArray();
                _allPerks.AddRange(perksVM);

                var groupVM = new PerkGroupVM(this, xmlGroup.Name, perksVM);
                PerkGroups.Add(groupVM);
            }
            ;
        }
Exemple #3
0
        public FlagVM(GameVM game, ref AmfObject flags, XmlEnum data)
        {
            _game        = game;
            _name        = data != null ? data.Name : "";
            _description = data != null ? data.Description : "";

            _flagsObject = flags;
            _flags       = new GeneralObjectVM(flags);
            bool hasFlag = _flags.HasValue(_name);

            if (hasFlag)
            {
                _flagValue = _flagsObject[_name];
            }
            GameVMProperties = new HashSet <string>();
        }
Exemple #4
0
        public GameVM(AmfFile file, GameVM previousVM)
            : base(file)
        {
            SetCharacterOptions();
            setCharacter("PC");

            var flagsObject = FlagsObject;

            _flags = new GeneralObjectVM(flagsObject);
            if (null != previousVM)
            {
                _perkSearchText    = previousVM._perkSearchText;
                _keyItemSearchText = previousVM._keyItemSearchText;
                _rawDataSearchText = previousVM._rawDataSearchText;
            }

            // Perks
            var charPerks        = Character.PerksArray;
            var xmlPerks         = XmlData.Current.PerkGroups.SelectMany(x => x.Perks).ToArray();
            var unknownPerkGroup = XmlData.Current.PerkGroups.Last();

            ImportMissingNamedVectors(charPerks, xmlPerks, "storageName", x => x.GetString("tooltip"), unknownPerkGroup.Perks);

            Character.PerkGroups = new List <PerkGroupVM>();
            foreach (var xmlGroup in XmlData.Current.PerkGroups)
            {
                var perksVM = xmlGroup.Perks.OrderBy(x => x.Name).Select(x => new PerkVM(this, charPerks, x)).ToArray();
                _allPerks.AddRange(perksVM);

                var groupVM = new PerkGroupVM(this, xmlGroup.Name, perksVM);
                Character.PerkGroups.Add(groupVM);
            }
            //Character.Perks = new UpdatableCollection<PerkVM>(_allPerks.Where(x => x.Match(PerkSearchText)));

            // KeyItems
            var keyItems = Character.KeyItemsArray;
            var xmlKeys  = XmlData.Current.KeyItems;

            ImportMissingNamedVectors(keyItems, xmlKeys, "storageName", x => x.GetString("tooltip"));
            _allKeyItems       = XmlData.Current.KeyItems.OrderBy(x => x.Name).Select(x => new KeyItemVM(this, keyItems, x)).ToArray();
            Character.KeyItems = new UpdatableCollection <KeyItemVM>(_allKeyItems.Where(x => x.Match(KeyItemSearchText)));

            // Statuses
            var statuses    = Character.StatusEffectsArray;
            var xmlStatuses = XmlData.Current.Statuses;

            ImportMissingNamedVectors(statuses, xmlStatuses, "storageName", x => x.GetString("tooltip"));
            _allStatuses            = XmlData.Current.Statuses.OrderBy(x => x.Name).Select(x => new StatusEffectVM(this, statuses, x)).ToArray();
            Character.StatusEffects = new UpdatableCollection <StatusEffectVM>(_allStatuses.Where(x => x.Match(RawDataSearchText)));

            // Flags
            foreach (var xmlFlag in XmlData.Current.Flags)
            {
                if (!_allFlags.ContainsKey(xmlFlag.Name))
                {
                    _allFlags[xmlFlag.Name] = new FlagVM(this, ref flagsObject, xmlFlag);
                }
            }
            foreach (var flag in flagsObject)
            {
                string flagName = flag.ToString();
                if (!_allFlags.ContainsKey(flagName))
                {
                    XmlEnum data = new XmlEnum();
                    data.Name           = flagName;
                    _allFlags[flagName] = new FlagVM(this, ref flagsObject, data);
                }
            }
            Flags = new UpdatableCollection <FlagVM>(_allFlags.Values.ToList().Where(x => x.Match(RawDataSearchText)));
        }
Exemple #5
0
        public GameVM(AmfFile file, GameVM previousVM)
            : base(file)
        {
            SetCharacterOptions();
            CharacterSelection = "PC";

            var shittyShips = GetObj("shittyShips") ?? new AmfObject(AmfTypes.Array);

            Ships = new ShipArrayVM(this, shittyShips);

            var flagsObject = FlagsObject;

            _flags = new GeneralObjectVM(flagsObject);

            // Flags
            var flagNames = AllFlags.Keys.ToList();

            foreach (var flagName in flagNames)
            {
                XmlEnum data = new XmlEnum();
                data.Name          = flagName;
                AllFlags[flagName] = new FlagVM(this, ref flagsObject, data);
            }

            foreach (var xmlFlag in XmlData.Current.Flags)
            {
                if (!AllFlags.ContainsKey(xmlFlag.Name))
                {
                    AllFlags[xmlFlag.Name] = new FlagVM(this, ref flagsObject, xmlFlag);
                }
            }

            foreach (var flag in flagsObject)
            {
                string flagName = flag.ToString();
                if (!AllFlags.ContainsKey(flagName))
                {
                    XmlEnum data = new XmlEnum();
                    data.Name          = flagName;
                    AllFlags[flagName] = new FlagVM(this, ref flagsObject, data);
                }
            }

            if (null != previousVM)
            {
                foreach (var flag in previousVM.AllFlags)
                {
                    string flagName = flag.Key.ToString();
                    if (!AllFlags.ContainsKey(flagName))
                    {
                        XmlEnum data = new XmlEnum();
                        data.Name          = flagName;
                        AllFlags[flagName] = new FlagVM(this, ref flagsObject, data);
                    }
                }
            }

            Flags = new UpdatableCollection <FlagVM>(AllFlags.Values.ToList().Where(x => x.Match(SearchText)));
            OnPropertyChanged("Flags");

            // Codex
            var codexEntries = AllCodexEntries.Keys.ToList();

            foreach (var codexName in codexEntries)
            {
                XmlCodexEntry data = new XmlCodexEntry();
                data.Name = codexName;
                AllCodexEntries[codexName] = new CodexEntryVM(this, data);
            }

            foreach (var xmlCodex in XmlData.Current.CodexEntries)
            {
                if (!AllCodexEntries.ContainsKey(xmlCodex.Name))
                {
                    AllCodexEntries[xmlCodex.Name] = new CodexEntryVM(this, xmlCodex);
                }
            }

            foreach (var codexEntry in CodexUnlockedEntriesObj)
            {
                string codexName = codexEntry.Value.ToString();
                if (!AllCodexEntries.ContainsKey(codexName))
                {
                    XmlCodexEntry data = new XmlCodexEntry(codexName);
                    AllCodexEntries[codexName] = new CodexEntryVM(this, data);
                }
            }

            foreach (var codexEntry in CodexViewedEntriesObj)
            {
                string codexName = codexEntry.Value.ToString();
                if (!AllCodexEntries.ContainsKey(codexName))
                {
                    XmlCodexEntry data = new XmlCodexEntry(codexName);
                    AllCodexEntries[codexName] = new CodexEntryVM(this, data);
                }
            }

            if (null != previousVM)
            {
                foreach (var codexEntry in previousVM.AllCodexEntries)
                {
                    string codexName = codexEntry.Value.ToString();
                    if (!AllCodexEntries.ContainsKey(codexName))
                    {
                        XmlCodexEntry data = new XmlCodexEntry(codexName);
                        AllCodexEntries[codexName] = new CodexEntryVM(this, data);
                    }
                }
            }

            CodexEntries = new UpdatableCollection <CodexEntryVM>(AllCodexEntries.Values.ToList().Where(x => x.Match(SearchText)));
            OnPropertyChanged("CodexEntries");
        }