20 lines
367 B
C++
20 lines
367 B
C++
#include "headers/Park_spot.h"
|
|
|
|
Park_spot::Park_spot(int id_){
|
|
parked = nullptr;
|
|
id = id_;
|
|
taken = false;
|
|
}
|
|
|
|
void Park_spot::clock(Customer* c_customer){
|
|
if (!taken){
|
|
parked = c_customer;
|
|
taken = true;
|
|
parked->clock_in(id);
|
|
}
|
|
else{
|
|
taken = false;
|
|
parked->clock_out(id);
|
|
parked = nullptr;
|
|
}
|
|
} |