public static int RoundedResourceStackCount(int stackCount) { if (stackCount > 200) { return(GenMath.RoundTo(stackCount, 10)); } if (stackCount > 100) { return(GenMath.RoundTo(stackCount, 5)); } return(stackCount); }
public static int RoundedResourceStackCount(int stackCount) { int result; if (stackCount > 200) { result = GenMath.RoundTo(stackCount, 10); } else if (stackCount > 100) { result = GenMath.RoundTo(stackCount, 5); } else { result = stackCount; } return(result); }
private static object RoundToTicksRough(object[] args) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; int num = Convert.ToInt32(args[0], invariantCulture); if (num <= 250) { return(250); } if (num < 5000) { return(GenMath.RoundTo(num, 250)); } if (num < 60000) { return(GenMath.RoundTo(num, 2500)); } if (num < 120000) { return(GenMath.RoundTo(num, 6000)); } return(GenMath.RoundTo(num, 60000)); }