public override void OnStation(int Station, int NeededStation, Color colorOfStation)
 {
     InTravel       = true;
     CurrentStation = Station;
     NeedStation    = NeededStation;
     StationColor   = colorOfStation;
     if (StationColor == Colors.Green)
     {
         TripInfo.Add(new Tuple <string, int, int, DateTime>("TrolleyBus", Station, NeededStation, DateTime.Now));
     }
     if (StationColor == Colors.Red)
     {
         TripInfo.Add(new Tuple <string, int, int, DateTime>("Tram", Station, NeededStation, DateTime.Now));
     }
     WriteStatistic();
 }
Example #2
0
        public override void Load(StreamReader sw)
        {
            name     = sw.ReadLine();
            years    = Convert.ToInt32(sw.ReadLine());
            x        = Convert.ToInt32(sw.ReadLine());
            y        = Convert.ToInt32(sw.ReadLine());
            active   = Convert.ToBoolean(sw.ReadLine());
            InTravel = Convert.ToBoolean(sw.ReadLine());
            if (InTravel == true)
            {
                InTravel       = Convert.ToBoolean(sw.ReadLine());
                InTransport    = Convert.ToBoolean(sw.ReadLine());
                CurrentStation = Convert.ToInt32(sw.ReadLine());
                NeedStation    = Convert.ToInt32(sw.ReadLine());
                int stStationColor = Convert.ToInt32(sw.ReadLine());
                if (stStationColor == 1)
                {
                    StationColor = Colors.Green;
                }
                if (stStationColor == 2)
                {
                    StationColor = Colors.Red;
                }
            }
            else
            {
                MotionStyle = Convert.ToInt32(sw.ReadLine());
            }
            int k = Convert.ToInt32(sw.ReadLine());

            for (int i = 0; i < k; i++)
            {
                String[] words = sw.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
                TripInfo.Add(new Tuple <string, int, int, DateTime>(words[0], Convert.ToInt32(words[1]), Convert.ToInt32(words[2]), Convert.ToDateTime(words[3])));
            }
            cash = Convert.ToDouble(sw.ReadLine());
            TypeOfPreferential = sw.ReadLine();
            WriteStatistic2();
        }