commenting my code

This commit is contained in:
TinyAtoms
2019-06-20 08:08:02 -03:00
parent e2c23647a5
commit 7840f791bb
6 changed files with 51 additions and 6 deletions

View File

@ -3,23 +3,42 @@
#include <thread> // to make pausing work, not sure if i need chrono, or this, or both
#include <vector>
/*
Code strucure like this:
als class declarations in /headers/class_naam.h, en definitions van de member objects in /class_naam.cpp
elke klas in zn eigen file omdat ik incomplete class declarations wilt tegengaan, omdat ik ze niet goed begrijp.
En header/source split om multiple definition errors tegen te gaan.
Park_spot representeert een parkeermeter bij elke parkeer spot.
Een customer is een customer.
Park time is een object die reffereert naar parkspot en customer, basically een 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.
*/
{
std::this_thread::sleep_for(seconds { sec });
}
using std::cout;
int main()
{
std::vector<Park_spot> spots {
1, 2, 3, 4, 5
};
std::vector<Customer> customers {
{ 1, "Sagar Ram", "eddgh" },
{ 2, "Shaq", "wsdfwefgv" },
{ 3, "Josh", "WDFGWEF" },
{ 4, "Stefano", "EDGGERG" }
{ 1, "Sagar Ram" },
{ 2, "Shaq" },
{ 3, "Josh" },
{ 4, "Stefano" }
};
spots[1].clock(&customers[3]); // stefano parks at spot 2