public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemPlayers            = base.Project.FindSubsystem <SubsystemPlayers>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemSky                = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemExplosions         = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFireBlockBehavior  = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     foreach (ValuesDictionary item in valuesDictionary.GetValue <ValuesDictionary>("Pickables").Values.Where((object v) => v is ValuesDictionary))
     {
         Pickable pickable = new Pickable();
         pickable.Value        = item.GetValue <int>("Value");
         pickable.Count        = item.GetValue <int>("Count");
         pickable.Position     = item.GetValue <Vector3>("Position");
         pickable.Velocity     = item.GetValue <Vector3>("Velocity");
         pickable.CreationTime = item.GetValue("CreationTime", 0.0);
         if (item.ContainsKey("StuckMatrix"))
         {
             pickable.StuckMatrix = item.GetValue <Matrix>("StuckMatrix");
         }
         m_pickables.Add(pickable);
     }
 }
Esempio n. 2
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     base.Load(valuesDictionary, idToEntityMap);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemMovingBlocks       = base.Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     BoxSize                  = valuesDictionary.GetValue <Vector3>("BoxSize");
     Mass                     = valuesDictionary.GetValue <float>("Mass");
     Density                  = valuesDictionary.GetValue <float>("Density");
     AirDrag                  = valuesDictionary.GetValue <Vector2>("AirDrag");
     WaterDrag                = valuesDictionary.GetValue <Vector2>("WaterDrag");
     WaterSwayAngle           = valuesDictionary.GetValue <float>("WaterSwayAngle");
     WaterTurnSpeed           = valuesDictionary.GetValue <float>("WaterTurnSpeed");
     Velocity                 = valuesDictionary.GetValue <Vector3>("Velocity");
     MaxSmoothRiseHeight      = valuesDictionary.GetValue <float>("MaxSmoothRiseHeight");
     ParentBody               = valuesDictionary.GetValue <EntityReference>("ParentBody").GetComponent <ComponentBody>(base.Entity, idToEntityMap, throwIfNotFound: false);
     ParentBodyPositionOffset = valuesDictionary.GetValue <Vector3>("ParentBodyPositionOffset");
     ParentBodyRotationOffset = valuesDictionary.GetValue <Quaternion>("ParentBodyRotationOffset");
     IsSmoothRiseEnabled      = true;
     IsGravityEnabled         = true;
     IsGroundDragEnabled      = true;
     IsWaterDragEnabled       = true;
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials     = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemPickables          = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
     m_subsystemBodies             = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemSky                = base.Project.FindSubsystem <SubsystemSky>(throwOnError: true);
     m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemNoise              = base.Project.FindSubsystem <SubsystemNoise>(throwOnError: true);
     m_subsystemExplosions         = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemBlockBehaviors     = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFluidBlockBehavior = base.Project.FindSubsystem <SubsystemFluidBlockBehavior>(throwOnError: true);
     m_subsystemFireBlockBehavior  = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     foreach (ValuesDictionary item in valuesDictionary.GetValue <ValuesDictionary>("Projectiles").Values.Where((object v) => v is ValuesDictionary))
     {
         Projectile projectile = new Projectile();
         projectile.Value        = item.GetValue <int>("Value");
         projectile.Position     = item.GetValue <Vector3>("Position");
         projectile.Velocity     = item.GetValue <Vector3>("Velocity");
         projectile.CreationTime = item.GetValue <double>("CreationTime");
         m_projectiles.Add(projectile);
     }
 }
Esempio n. 4
0
        public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            m_subsystemGameInfo       = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
            m_subsystemTimeOfDay      = base.Project.FindSubsystem <SubsystemTimeOfDay>(throwOnError: true);
            m_subsystemTerrain        = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            m_subsystemBlockBehaviors = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
            m_componentPlayer         = base.Entity.FindComponent <ComponentPlayer>(throwOnError: true);
            ContainerWidget guiWidget = m_componentPlayer.GuiWidget;

            m_backButtonWidget        = guiWidget.Children.Find <ButtonWidget>("BackButton");
            m_inventoryButtonWidget   = guiWidget.Children.Find <ButtonWidget>("InventoryButton");
            m_clothingButtonWidget    = guiWidget.Children.Find <ButtonWidget>("ClothingButton");
            m_moreButtonWidget        = guiWidget.Children.Find <ButtonWidget>("MoreButton");
            m_moreContentsWidget      = guiWidget.Children.Find <Widget>("MoreContents");
            m_helpButtonWidget        = guiWidget.Children.Find <ButtonWidget>("HelpButton");
            m_photoButtonWidget       = guiWidget.Children.Find <ButtonWidget>("PhotoButton");
            m_lightningButtonWidget   = guiWidget.Children.Find <ButtonWidget>("LightningButton");
            m_timeOfDayButtonWidget   = guiWidget.Children.Find <ButtonWidget>("TimeOfDayButton");
            m_cameraButtonWidget      = guiWidget.Children.Find <ButtonWidget>("CameraButton");
            m_creativeFlyButtonWidget = guiWidget.Children.Find <ButtonWidget>("CreativeFlyButton");
            m_sneakButtonWidget       = guiWidget.Children.Find <ButtonWidget>("SneakButton");
            m_mountButtonWidget       = guiWidget.Children.Find <ButtonWidget>("MountButton");
            m_editItemButton          = guiWidget.Children.Find <ButtonWidget>("EditItemButton");
            MoveWidget                     = guiWidget.Children.Find <TouchInputWidget>("Move");
            MoveRoseWidget                 = guiWidget.Children.Find <MoveRoseWidget>("MoveRose");
            LookWidget                     = guiWidget.Children.Find <TouchInputWidget>("Look");
            ViewWidget                     = m_componentPlayer.ViewWidget;
            HealthBarWidget                = guiWidget.Children.Find <ValueBarWidget>("HealthBar");
            FoodBarWidget                  = guiWidget.Children.Find <ValueBarWidget>("FoodBar");
            TemperatureBarWidget           = guiWidget.Children.Find <ValueBarWidget>("TemperatureBar");
            LevelLabelWidget               = guiWidget.Children.Find <LabelWidget>("LevelLabel");
            m_modalPanelContainerWidget    = guiWidget.Children.Find <ContainerWidget>("ModalPanelContainer");
            ControlsContainerWidget        = guiWidget.Children.Find <ContainerWidget>("ControlsContainer");
            m_leftControlsContainerWidget  = guiWidget.Children.Find <ContainerWidget>("LeftControlsContainer");
            m_rightControlsContainerWidget = guiWidget.Children.Find <ContainerWidget>("RightControlsContainer");
            m_moveContainerWidget          = guiWidget.Children.Find <ContainerWidget>("MoveContainer");
            m_lookContainerWidget          = guiWidget.Children.Find <ContainerWidget>("LookContainer");
            m_moveRectangleWidget          = guiWidget.Children.Find <RectangleWidget>("MoveRectangle");
            m_lookRectangleWidget          = guiWidget.Children.Find <RectangleWidget>("LookRectangle");
            m_moveRectangleContainerWidget = guiWidget.Children.Find <ContainerWidget>("MoveRectangleContainer");
            m_lookRectangleContainerWidget = guiWidget.Children.Find <ContainerWidget>("LookRectangleContainer");
            m_moveRectangleWidget          = guiWidget.Children.Find <RectangleWidget>("MoveRectangle");
            m_lookRectangleWidget          = guiWidget.Children.Find <RectangleWidget>("LookRectangle");
            m_movePadContainerWidget       = guiWidget.Children.Find <ContainerWidget>("MovePadContainer");
            m_lookPadContainerWidget       = guiWidget.Children.Find <ContainerWidget>("LookPadContainer");
            m_moveButtonsContainerWidget   = guiWidget.Children.Find <ContainerWidget>("MoveButtonsContainer");
            ShortInventoryWidget           = guiWidget.Children.Find <ShortInventoryWidget>("ShortInventory");
            m_largeMessageWidget           = guiWidget.Children.Find <ContainerWidget>("LargeMessage");
            m_messageWidget                = guiWidget.Children.Find <MessageWidget>("Message");
            m_keyboardHelpMessageShown     = valuesDictionary.GetValue <bool>("KeyboardHelpMessageShown");
            m_gamepadHelpMessageShown      = valuesDictionary.GetValue <bool>("GamepadHelpMessageShown");
        }
Esempio n. 5
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     m_subsystemAudio             = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemParticles         = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemTerrain           = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemNoise             = base.Project.FindSubsystem <SubsystemNoise>(throwOnError: true);
     m_subsystemBodies            = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemPickables         = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
     m_subsystemProjectiles       = base.Project.FindSubsystem <SubsystemProjectiles>(throwOnError: true);
     m_subsystemBlockBehaviors    = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     m_subsystemFireBlockBehavior = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     m_explosionParticleSystem    = new ExplosionParticleSystem();
     m_subsystemParticles.AddParticleSystem(m_explosionParticleSystem);
 }
Esempio n. 6
0
        public override void Load(ValuesDictionary valuesDictionary)
        {
            m_subsystemTerrain        = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            m_subsystemBlockBehaviors = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
            m_pollChunkCoordinates    = valuesDictionary.GetValue <Point2>("PollChunkCoordinates");
            Point2 value = valuesDictionary.GetValue <Point2>("PollPoint");

            m_pollX    = value.X;
            m_pollZ    = value.Y;
            m_pollPass = valuesDictionary.GetValue <int>("PollPass");
            m_pollableBehaviorsByContents = new SubsystemPollableBlockBehavior[BlocksManager.Blocks.Length][];
            for (int i = 0; i < m_pollableBehaviorsByContents.Length; i++)
            {
                m_pollableBehaviorsByContents[i] = (from s in m_subsystemBlockBehaviors.GetBlockBehaviors(i)
                                                    where s is SubsystemPollableBlockBehavior
                                                    select(SubsystemPollableBlockBehavior) s).ToArray();
            }
        }
Esempio n. 7
0
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemGameInfo       = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemTime           = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemExplosions     = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemProjectiles    = base.Project.FindSubsystem <SubsystemProjectiles>(throwOnError: true);
     m_subsystemBlockBehaviors = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     foreach (Projectile projectile in m_subsystemProjectiles.Projectiles)
     {
         ScanProjectile(projectile);
     }
     m_subsystemProjectiles.ProjectileAdded += delegate(Projectile projectile)
     {
         ScanProjectile(projectile);
     };
     m_subsystemProjectiles.ProjectileRemoved += delegate(Projectile projectile)
     {
         m_projectiles.Remove(projectile);
     };
 }
Esempio n. 8
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);
         }
     }
 }
Esempio n. 9
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     m_subsystemTerrain        = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemBodies         = base.Project.FindSubsystem <SubsystemBodies>(throwOnError: true);
     m_subsystemMovingBlocks   = base.Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);
     m_subsystemGameInfo       = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
     m_subsystemTime           = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
     m_subsystemAudio          = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemSoundMaterials = base.Project.FindSubsystem <SubsystemSoundMaterials>(throwOnError: true);
     m_subsystemBlockBehaviors = base.Project.FindSubsystem <SubsystemBlockBehaviors>(throwOnError: true);
     ComponentCreature         = base.Entity.FindComponent <ComponentCreature>(throwOnError: true);
     ComponentPlayer           = base.Entity.FindComponent <ComponentPlayer>();
     if (m_subsystemGameInfo.WorldSettings.GameMode == GameMode.Creative && ComponentPlayer != null)
     {
         Inventory = base.Entity.FindComponent <ComponentCreativeInventory>();
     }
     else
     {
         Inventory = base.Entity.FindComponent <ComponentInventory>();
     }
     AttackPower = valuesDictionary.GetValue <float>("AttackPower");
 }