Parkmanne/Park_spot.cpp

21 lines
467 B
C++
Raw Permalink Normal View History

2019-05-28 16:46:55 +00:00
#include "headers/Park_spot.h"
Park_spot::Park_spot(int id_){
parked = nullptr;
id = id_;
taken = false;
}
2019-06-20 11:08:02 +00:00
// clock in en out, calls de juist(in/out) van de customer aan de hand van internal state van taken
2019-05-28 16:46:55 +00:00
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;
}
}