Light12306/TrainInfomationProviderService/Utility.cs
2014-12-01 02:17:47 +08:00

38 lines
585 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TrainInfomationProviderService
{
class Utility
{
public static int CalculateTimeForCompare(char trainClass, double minutes)
{
var rate = 1.0;
switch (trainClass)
{
case 'G':
rate = 1.0;
break;
case 'D':
rate = 0.71428;
break;
case 'Z':
rate = 0.45714;
break;
case 'T':
rate = 0.4;
break;
default:
rate = 0.28571;
break;
}
return (int) (rate * minutes);
}
}
}