示例#1
0
        private static void LoadAll()
        {
            paramsList = new List <RuinGenerationParams>();
            foreach (ContentFile configFile in GameMain.Instance.GetFilesOfType(ContentType.RuinConfig))
            {
                XDocument doc = XMLExtensions.TryLoadXml(configFile.Path);
                if (doc?.Root == null)
                {
                    continue;
                }

                foreach (XElement subElement in doc.Root.Elements())
                {
                    var mainElement = subElement;
                    if (subElement.IsOverride())
                    {
                        mainElement = subElement.FirstElement();
                        paramsList.Clear();
                        DebugConsole.NewMessage($"Overriding all ruin generation parameters using the file {configFile.Path}.", Color.Yellow);
                    }
                    else if (paramsList.Any())
                    {
                        DebugConsole.NewMessage($"Adding additional ruin generation parameters from file '{configFile.Path}'");
                    }
                    var newParams = new RuinGenerationParams(mainElement, configFile.Path);
                    paramsList.Add(newParams);
                }
            }
        }
示例#2
0
 private static void LoadAll()
 {
     paramsList = new List <RuinGenerationParams>();
     foreach (string configFile in GameMain.Instance.GetFilesOfType(ContentType.RuinConfig))
     {
         XDocument doc = XMLExtensions.TryLoadXml(configFile);
         if (doc?.Root == null)
         {
             continue;
         }
         var newParams = new RuinGenerationParams(doc.Root)
         {
             filePath = configFile
         };
         paramsList.Add(newParams);
     }
 }
示例#3
0
 public Ruin(Level level, RuinGenerationParams generationParams, LocationType locationType, Point position, bool mirror = false)
 {
     this.generationParams = generationParams;
     Generate(level, locationType, position, mirror);
 }
示例#4
0
 public Ruin(Level level, RuinGenerationParams generationParams, Location location, Point position, bool mirror = false)
     : this(level, generationParams, location.Type, position, mirror)
 {
 }