コード例 #1
0
ファイル: ThingUtility.cs プロジェクト: sachdevs/RW-Decompile
 public static int RoundedResourceStackCount(int stackCount)
 {
     if (stackCount > 200)
     {
         return(GenMath.RoundTo(stackCount, 10));
     }
     if (stackCount > 100)
     {
         return(GenMath.RoundTo(stackCount, 5));
     }
     return(stackCount);
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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));
        }