add methods to decrement occupied spots and check if the parking lot is empty
This commit is contained in:
parent
82ea463b0c
commit
a8bebfc0fc
@ -29,7 +29,15 @@ class CarSpotController {
|
|||||||
this->occupied_spots++;
|
this->occupied_spots++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void decrement_occupied_spots () {
|
||||||
|
this->occupied_spots--;
|
||||||
|
}
|
||||||
|
|
||||||
bool is_full() {
|
bool is_full() {
|
||||||
return this->occupied_spots == this->total_spots;
|
return this->occupied_spots == this->total_spots;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_empty() {
|
||||||
|
return this->occupied_spots == 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user