Exemplo n.º 1
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemViews    = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
     m_subsystemTerrain  = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemGameInfo = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     foreach (ValuesDictionary value11 in valuesDictionary.GetValue <ValuesDictionary>("Texts").Values)
     {
         Point3 value   = value11.GetValue <Point3>("Point");
         string value2  = value11.GetValue("Line1", string.Empty);
         string value3  = value11.GetValue("Line2", string.Empty);
         string value4  = value11.GetValue("Line3", string.Empty);
         string value5  = value11.GetValue("Line4", string.Empty);
         Color  value6  = value11.GetValue("Color1", Color.Black);
         Color  value7  = value11.GetValue("Color2", Color.Black);
         Color  value8  = value11.GetValue("Color3", Color.Black);
         Color  value9  = value11.GetValue("Color4", Color.Black);
         string value10 = value11.GetValue("Url", string.Empty);
         SetSignData(value, new string[4]
         {
             value2,
             value3,
             value4,
             value5
         }, new Color[4]
         {
             value6,
             value7,
             value8,
             value9
         }, value10);
     }
     CreateRenderTarget();
     Display.DeviceReset += Display_DeviceReset;
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemTime          = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemParticles     = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemViews         = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
     m_subsystemAudio         = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemAmbientSounds = base.Project.FindSubsystem <SubsystemAmbientSounds>(throwOnError: true);
     for (int i = -2; i <= 2; i++)
     {
         for (int j = -1; j <= 2; j++)
         {
             for (int k = -2; k <= 2; k++)
             {
                 if (i != 0 || j != 0 || k != 0)
                 {
                     float num = (j < 0) ? 1.5f : 2.5f;
                     if (MathUtils.Sqrt(i * i + j * j + k * k) <= num)
                     {
                         float num2 = MathUtils.Sqrt(i * i + k * k);
                         float num3 = (j > 0) ? (0.5f * (float)j) : ((float)(-j));
                         m_expansionProbabilities[new Point3(i, j, k)] = 0.02f / (num2 + num3);
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     m_subsystemTime     = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemViews    = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
     m_subsystemGameInfo = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemSky      = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_componentFrame    = base.Entity.FindComponent <ComponentFrame>(throwOnError: true);
     m_componentModel    = base.Entity.FindComponent <ComponentModel>(throwOnError: true);
     m_creationTime      = m_subsystemTime.GameTime;
     Heading             = valuesDictionary.GetValue <float>("Heading");
 }
Exemplo n.º 4
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);
         }
     }
 }
Exemplo n.º 5
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemGameInfo = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemPlayers  = base.Project.FindSubsystem <SubsystemPlayers>(throwOnError: true);
     m_subsystemViews    = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
     m_subsystemTerrain  = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemTime     = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     foreach (KeyValuePair <string, object> item in valuesDictionary.GetValue <ValuesDictionary>("Chunks"))
     {
         ValuesDictionary valuesDictionary2 = (ValuesDictionary)item.Value;
         SpawnChunk       spawnChunk        = new SpawnChunk();
         spawnChunk.Point           = HumanReadableConverter.ConvertFromString <Point2>(item.Key);
         spawnChunk.IsSpawned       = valuesDictionary2.GetValue <bool>("IsSpawned");
         spawnChunk.LastVisitedTime = valuesDictionary2.GetValue <double>("LastVisitedTime");
         string value = valuesDictionary2.GetValue("SpawnsData", string.Empty);
         if (!string.IsNullOrEmpty(value))
         {
             LoadSpawnsData(value, spawnChunk.SpawnsData);
         }
         m_chunks[spawnChunk.Point] = spawnChunk;
     }
 }
Exemplo n.º 6
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemTime  = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemViews = base.Project.FindSubsystem <SubsystemGameWidgets>(throwOnError: true);
 }