This repository was archived by the owner on Dec 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.h
More file actions
62 lines (53 loc) · 1.47 KB
/
User.h
File metadata and controls
62 lines (53 loc) · 1.47 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef USER_H
#define USER_H
#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <map>
#include "Book.h"
class User{
public:
User(string userName, int id);
User(std::vector<std::string> info);
//Prints the User infomation
void PrintUser() const;
//Adds book to Users "hand"
//And updates book information
//accordingly
void addBook(Book* newBook);
//Returns book and removes it
//From Users "hand"
void returnBookUser(int id);
//Before User is deleted
//Force returns all books
void returnAllBooks();
//Searches through books
//Renews all books that are eligible
void renewAllBooks();
//Prints users book information
void PrintByUsersInfo() const;
//Determines if any book is overdue
bool getBooksOverDueStatus() const;
int getNumBooksCheckedOut() const{return hand.size();}
std::string getName() const{return name;}
bool numBook() const {return hand.size()==10;}
int getID() const {return userID;}
//For recommmendations function..
// vector<string> genreAndAuthor();
private:
//Basic user information
int userID;
std::string name;
//Stores number of books user has
int numOfUserBooks;
//Stores each book user currently has
std::vector<Book*> hand;
//Stores all of the books the user borrowed
std::unordered_set<int> historyOfBooks;
//Maps the genre/author to int
//To keep track of the user preferences
std::map<string, int> userGenre;
std::map<string, int> userAuthor;
};
#endif