still no clue
This commit is contained in:
54
main.cpp
54
main.cpp
@ -3,6 +3,7 @@
|
||||
#include <array>
|
||||
#include <thread>
|
||||
|
||||
|
||||
/*
|
||||
Code strucure like this:
|
||||
class declarations zijn in /headers/class_naam.h, en definitions van de member
|
||||
@ -18,9 +19,6 @@ record die zegt dat een customer voor x tijd geparkeert heeft bij spot x, enz.
|
||||
De client clockt in en uit bij een spot.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
void Wait(int sec)
|
||||
/*
|
||||
a wait function where 1 sec represents 1 hour irl.
|
||||
@ -31,27 +29,43 @@ a wait function where 1 sec represents 1 hour irl.
|
||||
|
||||
Customer* get_customer_ptr_for_parkspot(int id);
|
||||
|
||||
int main() {
|
||||
query_all_parking_spots();
|
||||
void debug(Customer c) {
|
||||
cout << "\n-----------" << &c << "-------------";
|
||||
cout << "\nid: " << c.id << "\nname:" << c.name
|
||||
<< "\ncar:" << int(c.verhicle);
|
||||
cout << "\n------------------------";
|
||||
}
|
||||
|
||||
void debug(Park_spot p) {
|
||||
cout << "\n------------" << &p << "\nid:" << p.id << "\ntaken: " << p.taken
|
||||
<< "\n customer:" << p.parked << "\n------------------";
|
||||
}
|
||||
|
||||
int main() {
|
||||
Customer p0 = query_customer_with_name("Shaquile")[0];
|
||||
Customer p1 = query_customer_with_name("Sagar Ramsaransing")[0];
|
||||
Customer p2 = query_customer_with_name("Joshua karto")[0];
|
||||
Customer p3 = query_customer_with_name("Stefan udit")[0];
|
||||
|
||||
parking_spots[2].clock(&p1);
|
||||
Wait(2);
|
||||
parking_spots[2].clock(&p1);
|
||||
Wait(1);
|
||||
parking_spots[0].clock(&p2);
|
||||
Wait(1);
|
||||
parking_spots[1].clock(&p3);
|
||||
Wait(1);
|
||||
parking_spots[0].clock(&p2);
|
||||
parking_spots[1].clock(&p3);
|
||||
Wait(1);
|
||||
parking_spots[1].clock(&p3);
|
||||
|
||||
query_all_parking_spots();
|
||||
// debug(p1);
|
||||
// debug(p0);
|
||||
// debug(p2);
|
||||
// debug(p3);
|
||||
cout << parking_spots.size();
|
||||
for (auto i: park_customers){
|
||||
debug(i);
|
||||
}
|
||||
|
||||
// parking_spots[2].clock(&p1);
|
||||
// Wait(2);
|
||||
// parking_spots[2].clock(&p1);
|
||||
// Wait(1);
|
||||
// parking_spots[0].clock(&p2);
|
||||
// Wait(1);
|
||||
// parking_spots[1].clock(&p3);
|
||||
// Wait(1);
|
||||
// parking_spots[0].clock(&p2);
|
||||
// parking_spots[1].clock(&p3);
|
||||
// Wait(1);
|
||||
// parking_spots[1].clock(&p3);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user