public static float SimRatioToFloat(SimRatio ratio) { switch (ratio) { case SimRatio.OFF: return(0f); case SimRatio.ONE_QUARTER: return(1f / 4f); case SimRatio.ONE_THIRD: return(1f / 3f); case SimRatio.HALF: return(1f / 2f); case SimRatio.TWO_THIRDS: return(2f / 3f); case SimRatio.THREE_QUARTER: return(3f / 4f); case SimRatio.FULL: return(1f); default: throw new ArgumentOutOfRangeException("unhandled simRatio"); } }
public static string Name(SimRatio ratio) { switch (ratio) { case SimRatio.OFF: return("OFF"); case SimRatio.ONE_QUARTER: return("25%"); case SimRatio.ONE_THIRD: return("33%"); case SimRatio.HALF: return("50%"); case SimRatio.TWO_THIRDS: return("66%"); case SimRatio.THREE_QUARTER: return("75%"); case SimRatio.FULL: return("FULL"); default: throw new ArgumentOutOfRangeException("unhandled simRatio"); } }