ProductionStatus GetRefineryStatus(IMyRefinery block) { if (!block.IsAlive() || !block.IsWorking) { return(ProductionStatus.Disabled); } else { return(block.IsProducing ? ProductionStatus.Producing : ProductionStatus.Waiting); } }
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); } }