Exemplo n.º 1
0
 public void DeleteWagon(Wagon wagon)
 {
     if (wagon.Seats.Any(s => s.IsBookedAnyDate()))
     {
         return;
     }
     Wagons.Remove(wagon);
     TrainsManager.SaveTrains();
 }
Exemplo n.º 2
0
 public Seat(Wagon wagon, SeatData seatData)
 {
     Wagon = wagon;
     Id    = seatData.Id;
     foreach (var timeDate in seatData.BookedDates)
     {
         var date = new Date(timeDate);
         _bookedDates.Add(date);
     }
 }
Exemplo n.º 3
0
 public Train(TrainsManager trainManager, TrainData trainData)
 {
     TrainsManager = trainManager;
     Id            = trainData.Id;
     Direction     = trainData.Direction;
     Wagons        = new List <Wagon>();
     foreach (var wagonData in trainData.Wagons)
     {
         var wagon = new Wagon(this, wagonData);
         Wagons.Add(wagon);
     }
 }
Exemplo n.º 4
0
 public Seat(Wagon wagon, int id)
 {
     Wagon = wagon;
     Id    = id;
 }