Example #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()));
 }
Example #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;
 }
Example #3
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemViews                = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
     SubsystemGameInfo               = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemParticles            = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemPickables            = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
     m_subsystemBlockBehaviors       = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     SubsystemAnimatedTextures       = base.Project.FindSubsystem <SubsystemAnimatedTextures>(throwOnError: true);
     SubsystemFurnitureBlockBehavior = base.Project.FindSubsystem <SubsystemFurnitureBlockBehavior>(throwOnError: true);
     SubsystemPalette                = base.Project.FindSubsystem <SubsystemPalette>(throwOnError: true);
     Terrain                = new Terrain();
     TerrainRenderer        = new TerrainRenderer(this);
     TerrainUpdater         = new TerrainUpdater(this);
     TerrainSerializer      = new TerrainSerializer22(Terrain, SubsystemGameInfo.DirectoryName);
     BlockGeometryGenerator = new BlockGeometryGenerator(Terrain, this, base.Project.FindSubsystem <SubsystemElectricity>(throwOnError: true), SubsystemFurnitureBlockBehavior, base.Project.FindSubsystem <SubsystemMetersBlockBehavior>(throwOnError: true), SubsystemPalette);
     if (string.CompareOrdinal(SubsystemGameInfo.WorldSettings.OriginalSerializationVersion, "2.1") <= 0)
     {
         TerrainGenerationMode terrainGenerationMode = SubsystemGameInfo.WorldSettings.TerrainGenerationMode;
         if (terrainGenerationMode == TerrainGenerationMode.FlatContinent || terrainGenerationMode == TerrainGenerationMode.FlatIsland)
         {
             TerrainContentsGenerator = new TerrainContentsGeneratorFlat(this);
         }
         else
         {
             TerrainContentsGenerator = new TerrainContentsGenerator21(this);
         }
     }
     else
     {
         TerrainGenerationMode terrainGenerationMode2 = SubsystemGameInfo.WorldSettings.TerrainGenerationMode;
         if (terrainGenerationMode2 == TerrainGenerationMode.FlatContinent || terrainGenerationMode2 == TerrainGenerationMode.FlatIsland)
         {
             TerrainContentsGenerator = new TerrainContentsGeneratorFlat(this);
         }
         else
         {
             TerrainContentsGenerator = new TerrainContentsGenerator22(this);
         }
     }
 }