Ejemplo n.º 1
0
 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);
     }
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemTerrain    = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemAudio      = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_subsystemExplosions = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
 {
     base.Load(valuesDictionary, idToEntityMap);
     m_subsystemTerrain     = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemExplosions  = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_componentBlockEntity = base.Entity.FindComponent <ComponentBlockEntity>(throwOnError: true);
     m_furnaceSize          = SlotsCount - 3;
     if (m_furnaceSize < 1 || m_furnaceSize > 3)
     {
         throw new InvalidOperationException("Invalid furnace size.");
     }
     m_fireTimeRemaining    = valuesDictionary.GetValue <float>("FireTimeRemaining");
     m_heatLevel            = valuesDictionary.GetValue <float>("HeatLevel");
     m_updateSmeltingRecipe = true;
 }
 public override void Load(ValuesDictionary valuesDictionary)
 {
     base.Load(valuesDictionary);
     m_subsystemTerrain           = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
     m_subsystemParticles         = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
     m_subsystemExplosions        = base.Project.FindSubsystem <SubsystemExplosions>(throwOnError: true);
     m_subsystemFireBlockBehavior = base.Project.FindSubsystem <SubsystemFireBlockBehavior>(throwOnError: true);
     m_subsystemAudio             = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
     m_fuseSound          = m_subsystemAudio.CreateSound("Audio/Fuse");
     m_fuseSound.IsLooped = true;
     foreach (ValuesDictionary value3 in valuesDictionary.GetValue <ValuesDictionary>("Explosives").Values)
     {
         Point3 value  = value3.GetValue <Point3>("Point");
         float  value2 = value3.GetValue <float>("TimeToExplosion");
         AddExplosive(value, value2);
     }
 }
Ejemplo n.º 6
0
 public static void Load(Project Project)
 {
     if (LoadedProject)
     {
         return;
     }
     SubsystemGameInfo                = Project.FindSubsystem <SubsystemGameInfo>(true);
     SubsystemAudio                   = Project.FindSubsystem <SubsystemAudio>(true);
     SubsystemBodies                  = Project.FindSubsystem <SubsystemBodies>(true);
     SubsystemTime                    = Project.FindSubsystem <SubsystemTime>(true);
     SubsystemItemsScanner            = Project.FindSubsystem <SubsystemItemsScanner>(true);
     SubsystemMovingBlocks            = Project.FindSubsystem <SubsystemMovingBlocks>(true);
     SubsystemBlockEntities           = Project.FindSubsystem <SubsystemBlockEntities>(true);
     SubsystemExplosions              = Project.FindSubsystem <SubsystemExplosions>(true);
     SubsystemCollapsingBlockBehavior = Project.FindSubsystem <SubsystemCollapsingBlockBehavior>(true);
     SubsystemPickables               = Project.FindSubsystem <SubsystemPickables>(true);
     SubsystemProjectiles             = Project.FindSubsystem <SubsystemProjectiles>(true);
     Terrain       = (SubsystemTerrain = Project.FindSubsystem <SubsystemTerrain>(true)).Terrain;
     LoadedProject = true;
 }
Ejemplo 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);
     };
 }