예제 #1
0
 ProductionStatus GetRefineryStatus(IMyRefinery block)
 {
     if (!block.IsAlive() || !block.IsWorking)
     {
         return(ProductionStatus.Disabled);
     }
     else
     {
         return(block.IsProducing ? ProductionStatus.Producing : ProductionStatus.Waiting);
     }
 }
예제 #2
0
        float CalculateProgressForRefinery(IMyRefinery block)
        {
            if (!block.IsAlive())
            {
                return(float.NaN);
            }
            IMyInventory inv = block.GetInventory(0);

            if ((double)inv.CurrentVolume > 0)
            {
                return((float)(1.0 - (double)inv.CurrentVolume / (double)inv.MaxVolume));
            }
            else
            {
                return(float.NaN);
            }
        }