src/station.cpp
branchcpp_gui
changeset 6254 abc6ad7c035c
parent 6253 23983700e3d7
child 6268 4b5241e5dd10
equal deleted inserted replaced
6253:23983700e3d7 6254:abc6ad7c035c
   500 bool RoadStop::HasFreeBay() const
   500 bool RoadStop::HasFreeBay() const
   501 {
   501 {
   502 	return GB(status, 0, MAX_BAY_COUNT) != 0;
   502 	return GB(status, 0, MAX_BAY_COUNT) != 0;
   503 }
   503 }
   504 
   504 
       
   505 /** Checks whether the given bay is free in this road stop */
       
   506 bool RoadStop::IsFreeBay(uint nr) const
       
   507 {
       
   508 	assert(nr < MAX_BAY_COUNT);
       
   509 	return HASBIT(status, nr);
       
   510 }
       
   511 
   505 /**
   512 /**
   506  * Allocates a bay
   513  * Allocates a bay
   507  * @return the allocated bay number
   514  * @return the allocated bay number
   508  * @pre this->HasFreeBay()
   515  * @pre this->HasFreeBay()
   509  */
   516  */
   518 	CLRBIT(status, bay_nr);
   525 	CLRBIT(status, bay_nr);
   519 	return bay_nr;
   526 	return bay_nr;
   520 }
   527 }
   521 
   528 
   522 /**
   529 /**
       
   530  * Allocates a bay in a drive-through road stop
       
   531  * @param nr the number of the bay to allocate
       
   532  */
       
   533 void RoadStop::AllocateDriveThroughBay(uint nr)
       
   534 {
       
   535 	assert(nr < MAX_BAY_COUNT);
       
   536 	CLRBIT(status, nr);
       
   537 }
       
   538 
       
   539 /**
   523  * Frees the given bay
   540  * Frees the given bay
   524  * @param nr the number of the bay to free
   541  * @param nr the number of the bay to free
   525  */
   542  */
   526 void RoadStop::FreeBay(uint nr)
   543 void RoadStop::FreeBay(uint nr)
   527 {
   544 {