Beispiel #1
0
 private void ConveyorSystemOnBlockAdded(MyCubeBlock myCubeBlock)
 {
     Sandbox.Game.Entities.Interfaces.IMyGasTank myGasTank = myCubeBlock as Sandbox.Game.Entities.Interfaces.IMyGasTank;
     if (myGasTank == null || !myGasTank.IsResourceStorage(MyResourceDistributorComponent.HydrogenId))
     {
         return;
     }
     this.m_maxHydrogen += myGasTank.GasCapacity;
     this.m_tankBlocks.Add(myGasTank);
 }
Beispiel #2
0
 private void Recalculate()
 {
     this.m_maxHydrogen = 0.0f;
     if (this.m_grid == null)
     {
         return;
     }
     foreach (IMyConveyorEndpointBlock conveyorEndpointBlock in this.m_grid.GridSystems.ConveyorSystem.ConveyorEndpointBlocks)
     {
         Sandbox.Game.Entities.Interfaces.IMyGasTank myGasTank = conveyorEndpointBlock as Sandbox.Game.Entities.Interfaces.IMyGasTank;
         if (myGasTank != null && myGasTank.IsResourceStorage(MyResourceDistributorComponent.HydrogenId))
         {
             this.m_maxHydrogen += myGasTank.GasCapacity;
             this.m_tankBlocks.Add(myGasTank);
         }
     }
 }