forked from workattech/mock-machine-coding-3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.cpp
More file actions
38 lines (30 loc) · 836 Bytes
/
user.cpp
File metadata and controls
38 lines (30 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
#include "card.h"
#include "user.h"
using namespace std;
User::User(string name, string email, string id){
this->name = name;
this->email = email;
this->id = id;
cout << "User created with name:" << name << " id:" << id << " email:" << email << endl;
}
void User::myCards(){
cout << "User " << name << " has following cards assigned:" << endl;
for(set<Card*>::iterator it=cardsAssigned.begin(); it!=cardsAssigned.end(); it++)
(*it)->printCard();
}
void User::printUser(){
cout << "User name:" << name << " id:" << id << " email:" << email << endl;
}
void User::addCard(Card* card){
cardsAssigned.insert(card);
}
void User::unassignCard(Card* card){
cardsAssigned.erase(card);
}
string User::getId(){
return id;
}
string User::getName(){
return name;
}