Exemple #1
0
        new public static PlanetClass FromEDName(string edname)
        {
            if (edname == null)
            {
                return(null);
            }

            string normalizedEDName = edname.Replace(" ", "").Replace("-", "");

            return(ResourceBasedLocalizedEDName <PlanetClass> .FromEDName(normalizedEDName));
        }
Exemple #2
0
        public new static NpcSuitLoadout FromEDName(string edname)
        {
            if (string.IsNullOrEmpty(edname))
            {
                return(null);
            }
            var(tidiedName, grade) = titiedEDName(edname);
            var result = ResourceBasedLocalizedEDName <NpcSuitLoadout> .FromEDName(tidiedName);

            if (result != null)
            {
                result.grade = grade;
            }
            return(result);
        }
Exemple #3
0
        public static Suit FromEDName(string edname, long?suitId = null)
        {
            if (string.IsNullOrEmpty(edname))
            {
                return(null);
            }
            var(tidiedName, grade) = titiedEDName(edname);
            var result = ResourceBasedLocalizedEDName <Suit> .FromEDName(tidiedName);

            if (result != null)
            {
                result.grade = grade; result.suitId = suitId;
            }
            return(result);
        }
Exemple #4
0
        new public static AtmosphereClass FromEDName(string edname)
        {
            if (edname == null)
            {
                return(FromEDName("None"));
            }

            // Temperature and pressure are defined separately so we remove them from this string (if descriptors are present)
            string normalizedEDName = edname
                                      .ToLowerInvariant()
                                      .Replace("thick ", "")
                                      .Replace("thin ", "")
                                      .Replace("hot ", "")
                                      .Replace(" ", "")
                                      .Replace("-", "");

            return(ResourceBasedLocalizedEDName <AtmosphereClass> .FromEDName(normalizedEDName));
        }
Exemple #5
0
        public static MicroResource FromEDName(string edname, string fallbackName = null, string categoryEdName = null)
        {
            if (edname == null)
            {
                return(None);
            }
            string normalizedEDName = edname
                                      .ToLowerInvariant()
                                      .Replace("$", "")
                                      .Replace("_name;", "");
            var result = ResourceBasedLocalizedEDName <MicroResource> .FromEDName(normalizedEDName);

            result.fallbackLocalizedName = fallbackName;
            if (!string.IsNullOrEmpty(categoryEdName))
            {
                result.Category = MicroResourceCategory.FromEDName(categoryEdName);
            }
            return(result);
        }
Exemple #6
0
        public new static SignalSource FromEDName(string from)
        {
            if (from != null)
            {
                if (from.Contains("$"))
                {
                    string tidiedFrom = from
                                        .Replace("$", "")
                                        .Replace(";", "");

                    // Extract any sub-type from the name (e.g. $SAA_Unknown_Signal:#type=$SAA_SignalType_Geological;:#index=3; )
                    if (tidiedFrom.Contains(":#type="))
                    {
                        string[] fromArray = tidiedFrom.Split(new[] { ":#type=" }, System.StringSplitOptions.None);
                        tidiedFrom = fromArray[1];
                    }

                    // Extract any index value which might be present and then strip the index value
                    int indexResult = 0;
                    if (tidiedFrom.Contains(":#index="))
                    {
                        string[] fromArray = tidiedFrom.Split(new[] { ":#index=" }, System.StringSplitOptions.None);
                        if (int.TryParse(fromArray[1], out indexResult))
                        {
                        }
                        tidiedFrom = fromArray[0];
                    }

                    // Find our signal source
                    SignalSource result = ResourceBasedLocalizedEDName <SignalSource> .FromEDName(tidiedFrom);

                    // Include our index value with our result
                    result.index = indexResult;

                    return(result);
                }
            }
            return(null);
        }
Exemple #7
0
        new public static CommodityDefinition FromEDName(string rawName)
        {
            string edName = NormalizedName(rawName);

            return(ResourceBasedLocalizedEDName <CommodityDefinition> .FromEDName(edName));
        }
Exemple #8
0
        new public static Composition FromEDName(string edname)
        {
            string normalizedEDName = edname.Replace("eRingClass_", "").Replace("-", "");

            return(ResourceBasedLocalizedEDName <Composition> .FromEDName(normalizedEDName));
        }
Exemple #9
0
        new public MaterialCategory FromEDName(string edname)
        {
            string normalizedEDName = edname.Replace("$MICRORESOURCE_CATEGORY_", "").Replace(";", "");

            return(ResourceBasedLocalizedEDName <MaterialCategory> .FromEDName(normalizedEDName));
        }