public GameInfo(ProjectData project) { XElement e = project.GetSubsystem("GameInfo"); e.GetValue("WorldName", out WorldName); e.GetValue("WorldSeedString", out WorldSeed); e.GetValue("TerrainGenerationMode", out TerrainGenerationMode); e.GetValue("TerrainLevel", out TerrainLevel); e.GetValue("TerrainBlockIndex", out TerrainBlockIndex); e.GetValue("TerrainOceanBlockIndex", out TerrainOceanBlockIndex); e.GetValue("TemperatureOffset", out TemperatureOffset); e.GetValue("HumidityOffset", out HumidityOffset); e.GetValue("SeaLevelOffset", out SeaLevelOffset); e.GetValueOrDefault("BiomeSize", out BiomeSize, 0); e.GetValueOrDefault("BlockTextureName", out BlockTextureName, ""); string str; XElement palette = XMLUtils.FindValuesByName(e, "Palette"); if (palette != null) { palette.GetValue("Colors", out str); Colors = str.Split(';'); } else { Colors = new string[16]; } }
public XElement GetSubsystem(string name) { return(XMLUtils.FindValuesByName(Root.Element("Subsystems"), name)); }