In this simple model, no data is stored about who has reserved which
places (seats) in the cars. Cars only know if places are reserved or
not.
|
__init__(self,
number_of_rows,
row_width)
Creates a new sitting car with the given number of seat rows, and the
given number of seats per row. |
|
|
float
|
|
int
|
|
int
|
get_row_width(self)
Returns the number of seats per row in the car. |
|
|
int
|
|
int
|
|
boolean
|
is_seat_reserved(self,
number_of_row,
seat)
Tells if the indicated seat is reserved or not. |
|
|
boolean
|
reserve_place(self,
number_of_row,
seat)
Reserves the indicated seat, if possible. |
|
|
boolean
|
reserve_places(self,
number_of_people)
Reserves places (seats) for a group. |
|
|
int
|
find_adjacents(self,
row_index,
seat_index,
number_of_seats)
Tells if the given number of adjacent seats are free at the given
location in the car. |
|
|
|
reserve_adjacents(self,
row_index,
seat_index,
number_of_seats)
Reserves the given number of adjacent seats starting at the given
location in the car. |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|