Esempio n. 1
0
 public void Load(ValuesDictionary valuesDictionary)
 {
     Name = valuesDictionary.GetValue <string>("WorldName");
     OriginalSerializationVersion = valuesDictionary.GetValue("OriginalSerializationVersion", string.Empty);
     Seed     = valuesDictionary.GetValue("WorldSeedString", string.Empty);
     GameMode = valuesDictionary.GetValue("GameMode", GameMode.Challenging);
     EnvironmentBehaviorMode              = valuesDictionary.GetValue("EnvironmentBehaviorMode", EnvironmentBehaviorMode.Living);
     TimeOfDayMode                        = valuesDictionary.GetValue("TimeOfDayMode", TimeOfDayMode.Changing);
     StartingPositionMode                 = valuesDictionary.GetValue("StartingPositionMode", StartingPositionMode.Easy);
     AreWeatherEffectsEnabled             = valuesDictionary.GetValue("AreWeatherEffectsEnabled", defaultValue: true);
     IsAdventureRespawnAllowed            = valuesDictionary.GetValue("IsAdventureRespawnAllowed", defaultValue: true);
     AreAdventureSurvivalMechanicsEnabled = valuesDictionary.GetValue("AreAdventureSurvivalMechanicsEnabled", defaultValue: true);
     AreSupernaturalCreaturesEnabled      = valuesDictionary.GetValue("AreSupernaturalCreaturesEnabled", defaultValue: true);
     IsFriendlyFireEnabled                = valuesDictionary.GetValue("IsFriendlyFireEnabled", defaultValue: true);
     TerrainGenerationMode                = valuesDictionary.GetValue("TerrainGenerationMode", TerrainGenerationMode.Continent);
     IslandSize             = valuesDictionary.GetValue("IslandSize", new Vector2(200f, 200f));
     TerrainLevel           = valuesDictionary.GetValue("TerrainLevel", 64);
     ShoreRoughness         = valuesDictionary.GetValue("ShoreRoughness", 0f);
     TerrainBlockIndex      = valuesDictionary.GetValue("TerrainBlockIndex", 8);
     TerrainOceanBlockIndex = valuesDictionary.GetValue("TerrainOceanBlockIndex", 18);
     TemperatureOffset      = valuesDictionary.GetValue("TemperatureOffset", 0f);
     HumidityOffset         = valuesDictionary.GetValue("HumidityOffset", 0f);
     SeaLevelOffset         = valuesDictionary.GetValue("SeaLevelOffset", 0);
     BiomeSize         = valuesDictionary.GetValue("BiomeSize", 1f);
     BlocksTextureName = valuesDictionary.GetValue("BlockTextureName", string.Empty);
     Palette           = new WorldPalette(valuesDictionary.GetValue("Palette", new ValuesDictionary()));
 }
Esempio n. 2
0
 public void ResetOptionsForNonCreativeMode()
 {
     if (TerrainGenerationMode == TerrainGenerationMode.FlatContinent)
     {
         TerrainGenerationMode = TerrainGenerationMode.Continent;
     }
     if (TerrainGenerationMode == TerrainGenerationMode.FlatIsland)
     {
         TerrainGenerationMode = TerrainGenerationMode.Island;
     }
     EnvironmentBehaviorMode              = EnvironmentBehaviorMode.Living;
     TimeOfDayMode                        = TimeOfDayMode.Changing;
     AreWeatherEffectsEnabled             = true;
     IsAdventureRespawnAllowed            = true;
     AreAdventureSurvivalMechanicsEnabled = true;
     TerrainLevel      = 64;
     ShoreRoughness    = 0.5f;
     TerrainBlockIndex = 8;
 }