park time can be saved to db now
This commit is contained in:
21
Park_spot.cpp
Normal file
21
Park_spot.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "headers/Park_spot.h"
|
||||
|
||||
Park_spot::Park_spot(int id_){
|
||||
parked = nullptr;
|
||||
id = id_;
|
||||
taken = false;
|
||||
}
|
||||
|
||||
// clock in en out, calls de juist(in/out) van de customer aan de hand van internal state van taken
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user