public static int Row(this IBoardingPass boardingPass) { if (boardingPass == null) { throw new ArgumentNullException(nameof(boardingPass)); } if (boardingPass.IsValid() == false) { throw new ArgumentException(nameof(boardingPass)); } return(CalculateRowPosition(boardingPass)); }
public static int SeatId(this IBoardingPass boardingPass) { if (boardingPass == null) { throw new ArgumentNullException(nameof(boardingPass)); } if (boardingPass.IsValid() == false) { throw new ArgumentException(nameof(boardingPass)); } // (row x 8) + col return((Row(boardingPass) * 8) + Column(boardingPass)); }