Beispiel #1
0
        private int CountZones(Journey journey)
        {
            var zonesStart = journey.GetStartPoint().GetZone().Split(',');
            var zonesEnd   = journey.GetEndPoint().GetZone().Split(',');

            int x = 10;

            for (int i = 0; i < zonesStart.Length; i++)
            {
                for (int j = 0; j < zonesEnd.Length; j++)
                {
                    int z = int.Parse(zonesStart[i]);
                    int y = int.Parse(zonesEnd[j]);
                    z = Math.Abs(z - y);
                    if (z < x)
                    {
                        x = z;
                    }
                }
            }

            return(Math.Abs(x));
        }
Beispiel #2
0
 private bool IsZoneTwo(Journey journey)
 {
     return(journey.GetEndPoint().GetZone().Contains("2") && journey.GetStartPoint().GetZone().Contains("2"));
 }
Beispiel #3
0
 private bool HaveZoneOne(Journey journey)
 {
     return(journey.GetEndPoint().GetZone().Contains("1") || journey.GetStartPoint().GetZone().Contains("1"));
 }