Exemple #1
0
        private static CustomizationDefinition CreateCustomization(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.CustomizationDefinition> kv)
        {
            var raw = kv.Value;

            DownloadableContentDefinition content = null;

            if (string.IsNullOrEmpty(raw.DLC) == false)
            {
                if (downloadableContents.TryGetValue(raw.DLC, out content) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLC);
                }
            }

            return(new CustomizationDefinition()
            {
                ResourcePath = kv.Key,
                Name = raw.Name,
                Type = raw.Type,
                Usage = raw.Usage,
                DataName = raw.DataName,
                PrimarySort = raw.PrimarySort,
                SecondarySort = raw.SecondarySort,
                DLC = content,
            });
        }
Exemple #2
0
        private static TravelStationDefinition GetTravelStationDefinition(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.TravelStationDefinition> kv)
        {
            DownloadableContentDefinition dlcExpansion = null;

            if (string.IsNullOrEmpty(kv.Value.DLCExpansion) == false)
            {
                if (downloadableContents.ContainsKey(kv.Value.DLCExpansion) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLCExpansion);
                }
                dlcExpansion = downloadableContents[kv.Value.DLCExpansion];
            }

            if (kv.Value is Raw.FastTravelStationDefinition)
            {
                return(GetFastTravelStationDefinition(dlcExpansion, kv));
            }

            if (kv.Value is Raw.LevelTravelStationDefinition)
            {
                return(GetLevelTravelStationDefinition(dlcExpansion, kv));
            }

            throw new InvalidOperationException();
        }
Exemple #3
0
        private static PlayerClassDefinition CreatePlayerClass(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.PlayerClassDefinition> kv)
        {
            var raw = kv.Value;

            DownloadableContentDefinition downloadableContent = null;

            if (string.IsNullOrEmpty(raw.DLC) == false)
            {
                if (downloadableContents.TryGetValue(kv.Value.DLC, out downloadableContent) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", raw.DLC);
                }
            }

            return(new PlayerClassDefinition()
            {
                ResourcePath = kv.Key,
                Name = raw.Name,
                Class = raw.Class,
                SortOrder = raw.SortOrder,
                DLC = downloadableContent,
            });
        }
Exemple #4
0
        private static TravelStationDefinition CreateFastTravelStation(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            string path,
            Raw.FastTravelStationDefinition raw)
        {
            DownloadableContentDefinition dlcExpansion = null;

            if (string.IsNullOrEmpty(raw.DLCExpansion) == false)
            {
                if (downloadableContents.TryGetValue(raw.DLCExpansion, out dlcExpansion) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", raw.DLCExpansion);
                }
            }
            return(new FastTravelStationDefinition()
            {
                ResourcePath = path,
                ResourceName = raw.ResourceName,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                StationDisplayName = raw.StationDisplayName,
                MissionDependencies = CreateMissionStatusData(raw.MissionDependencies),
                InitiallyActive = raw.InitiallyActive,
                SendOnly = raw.SendOnly,
                Description = raw.Description,
                Sign = raw.Sign,
                InaccessibleObjective = raw.InaccessibleObjective,
                AccessibleObjective = raw.AccessibleObjective,
            });
        }
Exemple #5
0
        private static CustomizationDefinition GetCustomizationDefinition(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.CustomizationDefinition> kv)
        {
            DownloadableContentDefinition content = null;

            if (string.IsNullOrEmpty(kv.Value.DLC) == false)
            {
                if (downloadableContents.ContainsKey(kv.Value.DLC) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLC);
                }
                content = downloadableContents[kv.Value.DLC];
            }

            return(new CustomizationDefinition()
            {
                ResourcePath = kv.Key,
                Name = kv.Value.Name,
                Type = kv.Value.Type,
                Usage = kv.Value.Usage,
                DataName = kv.Value.DataName,
                PrimarySort = kv.Value.PrimarySort,
                SecondarySort = kv.Value.SecondarySort,
                DLC = content,
            });
        }
        private static TravelStationDefinition GetLevelTravelStationDefinition(
            DownloadableContentDefinition dlcExpansion, KeyValuePair <string, Raw.TravelStationDefinition> kv)
        {
            var raw = (Raw.LevelTravelStationDefinition)kv.Value;

            return(new LevelTravelStationDefinition()
            {
                ResourcePath = kv.Key,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                DisplayName = raw.DisplayName,
                MissionDependencies = GetMissionStatusData(kv.Value.MissionDependencies),
            });
        }
        private static string GetDLCName(DownloadableContentDefinition dlc, out int priority)
        {
            if (dlc == null)
            {
                priority = int.MinValue;
                return("Base Game");
            }

            if (dlc.Package != null)
            {
                priority = dlc.Package.Id;
                return(dlc.Package.DisplayName);
            }

            priority = int.MaxValue;
            return("??? " + dlc.ResourcePath + " ???");
        }
        private static TravelStationDefinition GetFastTravelStationDefinition(
            DownloadableContentDefinition dlcExpansion, KeyValuePair <string, Raw.TravelStationDefinition> kv)
        {
            var raw = (Raw.FastTravelStationDefinition)kv.Value;

            return(new FastTravelStationDefinition()
            {
                ResourcePath = kv.Key,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                DisplayName = raw.DisplayName,
                MissionDependencies = GetMissionStatusData(raw.MissionDependencies),
                InitiallyActive = raw.InitiallyActive,
                SendOnly = raw.SendOnly,
                Description = raw.Description,
                Sign = raw.Sign,
                InaccessibleObjective = raw.InaccessibleObjective,
                AccessibleObjective = raw.AccessibleObjective,
            });
        }
        private static FastTravelStationOrdering GetFastTravelStationOrdering(
            InfoDictionary <TravelStationDefinition> travelStations,
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.FastTravelStationOrdering> kv)
        {
            DownloadableContentDefinition dlcExpansion = null;

            if (string.IsNullOrEmpty(kv.Value.DLCExpansion) == false)
            {
                if (downloadableContents.ContainsKey(kv.Value.DLCExpansion) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLCExpansion);
                }
                dlcExpansion = downloadableContents[kv.Value.DLCExpansion];
            }

            return(new FastTravelStationOrdering()
            {
                ResourcePath = kv.Key,
                Stations = GetStations(travelStations, kv.Value.Stations),
                DLCExpansion = dlcExpansion,
            });
        }
        private static PlayerClassDefinition GetPlayerClassDefinition(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.PlayerClassDefinition> kv)
        {
            DownloadableContentDefinition content = null;

            if (string.IsNullOrEmpty(kv.Value.DLC) == false)
            {
                if (downloadableContents.ContainsKey(kv.Value.DLC) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLC);
                }
                content = downloadableContents[kv.Value.DLC];
            }

            return(new PlayerClassDefinition()
            {
                ResourcePath = kv.Key,
                Name = kv.Value.Name,
                Class = kv.Value.Class,
                SortOrder = kv.Value.SortOrder,
                DLC = content,
            });
        }
        private static FastTravelStationOrdering CreateFastTravelStationOrdering(
            InfoDictionary <TravelStationDefinition> stations,
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.FastTravelStationOrdering> kv)
        {
            var raw = kv.Value;

            DownloadableContentDefinition dlcExpansion = null;

            if (string.IsNullOrEmpty(raw.DLCExpansion) == false)
            {
                if (downloadableContents.TryGetValue(raw.DLCExpansion, out dlcExpansion) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", kv.Value.DLCExpansion);
                }
            }

            return(new FastTravelStationOrdering()
            {
                ResourcePath = kv.Key,
                Stations = CreateStations(stations, raw.Stations),
                DLCExpansion = dlcExpansion,
            });
        }
Exemple #12
0
        private static TravelStationDefinition CreateLevelTravelStation(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            string path,
            Raw.LevelTravelStationDefinition raw)
        {
            DownloadableContentDefinition dlcExpansion = null;

            if (string.IsNullOrEmpty(raw.DLCExpansion) == false)
            {
                if (downloadableContents.TryGetValue(raw.DLCExpansion, out dlcExpansion) == false)
                {
                    throw ResourceNotFoundException.Create("downloadable content", raw.DLCExpansion);
                }
            }
            return(new LevelTravelStationDefinition()
            {
                ResourcePath = path,
                ResourceName = raw.ResourceName,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                StationDisplayName = raw.StationDisplayName,
                MissionDependencies = CreateMissionStatusData(raw.MissionDependencies),
            });
        }
Exemple #13
0
        private static CustomizationDefinition GetCustomizationDefinition(
            InfoDictionary <DownloadableContentDefinition> downloadableContents,
            KeyValuePair <string, Raw.CustomizationDefinition> kv)
        {
            DownloadableContentDefinition content = null;

            if (string.IsNullOrEmpty(kv.Value.DLC) == false)
            {
                if (downloadableContents.ContainsKey(kv.Value.DLC) == false)
                {
                    throw new KeyNotFoundException("could not find downloadable content " + kv.Value.DLC);
                }
                content = downloadableContents[kv.Value.DLC];
            }

            return(new CustomizationDefinition()
            {
                ResourcePath = kv.Key,
                Name = kv.Value.Name,
                Type = kv.Value.Type,
                Usage = kv.Value.Usage,
                DLC = content,
            });
        }
        private static TravelStationDefinition GetFastTravelStationDefinition(
            DownloadableContentDefinition dlcExpansion, KeyValuePair<string, Raw.TravelStationDefinition> kv)
        {
            var raw = (Raw.FastTravelStationDefinition)kv.Value;

            return new FastTravelStationDefinition()
            {
                ResourcePath = kv.Key,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                DisplayName = raw.DisplayName,
                MissionDependencies = GetMissionStatusData(raw.MissionDependencies),
                InitiallyActive = raw.InitiallyActive,
                SendOnly = raw.SendOnly,
                Description = raw.Description,
                Sign = raw.Sign,
                InaccessibleObjective = raw.InaccessibleObjective,
                AccessibleObjective = raw.AccessibleObjective,
            };
        }
        private static TravelStationDefinition GetLevelTravelStationDefinition(
            DownloadableContentDefinition dlcExpansion, KeyValuePair<string, Raw.TravelStationDefinition> kv)
        {
            var raw = (Raw.LevelTravelStationDefinition)kv.Value;

            return new LevelTravelStationDefinition()
            {
                ResourcePath = kv.Key,
                LevelName = raw.LevelName,
                DLCExpansion = dlcExpansion,
                DisplayName = raw.DisplayName,
                MissionDependencies = GetMissionStatusData(kv.Value.MissionDependencies),
            };
        }