Parkmanne/src/Customer.cpp

30 lines
770 B
C++
Raw Normal View History

2019-05-28 16:46:55 +00:00
#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) {
// need some logic to only include from this month
std::cout << i;
}
std::cout << "-------------------------------------------------\n\n";
}