示例#1
0
 public bool Equals(Seat seat)
 {
     return(seat != null &&
            Coach.Equals(seat.Coach) &&
            SeatNumber == seat.SeatNumber);
 }
示例#2
0
 public Seat(Coach coach, int seatNumber)
 {
     Coach      = coach;
     SeatNumber = seatNumber;
 }
示例#3
0
        public static Train Of(List <Seat> seats)
        {
            List <Coach> coaches = seats.GroupBy(e => e.Coach).Select(grouping => Coach.Of(grouping.ToList())).ToList();

            return(new Train(coaches));
        }
示例#4
0
 public static Result WasSucces(Coach coach)
 {
     return(new Success(coach));
 }
示例#5
0
 internal Success(Coach coach) => this.Coach = coach;
示例#6
0
 public override int GetHashCode()
 {
     return(Coach != null ? Coach.GetHashCode() : 0);
 }