Parkmanne/Customer.cpp
2019-05-28 18:02:52 -03:00

30 lines
776 B
C++

#include "headers/Customer.h"
#include <iostream>
Customer::Customer(int id_, string name_, string card_code_)
: id { id_ }
, name { name_ }
, card_code { card_code_ }
{
}
void Customer::clock_in( int s_id)
{
Park_time pt{id, s_id};
park_instances.push_back(pt);
}
void Customer::clock_out(int s_id){
park_instances[park_instances.size()-1].clock_out(id, s_id);
}
void Customer::gen_monthly(){
std::cout << "NAME: " << name << " card code: " << card_code << "\n";
std::cout << "-------------------------------------------------\n";
for (auto& i : park_instances) {
// TODO: need some logic to only include from this month
std::cout << i;
}
std::cout << "-------------------------------------------------\n\n";
}