-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMovie.h
152 lines (134 loc) · 2.74 KB
/
Movie.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#include <iostream>
#include <vector>
#include <map>
class Movie;
class Customer;
class Inventory;
using namespace std;
class MovieStore{
public:
MovieStore();
~MovieStore();
bool borrow(Movie*, int);
bool returnMovie(Movie*, int);
void inventory();
void history(int);
private:
map<int, Customer*> Customers;
Inventory Stock;
};
class Inventory{
public:
void displayInventory();
private:
map<string, Movie*> Comedies;
map<string, Movie*> Dramas;
map<string, Movie*> Classics;
bool addMovie(char, string);
bool borrowMovie(char, string);
bool returnMovie(char, string);
};
class Customer{
public:
Customer(int, string, string);
~Customer();
int getID() const;
string getFirstName() const;
string getLastName() const;
string parseTransaction(string&);
private:
int CustomerID;
string FirstName;
string LastName;
vector<string> TransactionHistory;
};
class History{
public:
void displayHistory();
void clearHistory();
void displayLastTransaction();
private:
vector<string> TransactionHistory;
};
class Transaction{
public:
bool borrow(string);
bool returnM(string); // was return changed to returnM for return movie
private:
};
class Borrow : public Transaction{
public:
private:
bool borrowMovie(char, string);
};
class Return : public Transaction{
public:
private:
bool returnMovie(char, string);
};
// need to template class
class HashMap{
public:
HashMap();
HashMap(char, MovieFactory*);
~HashMap();
bool contains(int);
void insert(T, T);
void add(searchKey, newItem);
private:
key_pair<T,T>;
};
class MovieFactory {
public:
virtual Movie *create() const = 0;
private:
};
class Movie{
public:
static Movie *create(const string&);
virtual ~Movie() = default;
static void registerType(const string&, MovieFactory*);
virtual bool operator>(const Movie&) = 0;
public:
private:
int Stock;
string Title;
string YearRelease;
string DirectorFirst;
string DirectorLast;
HashMap(char, MovieFactory*) Factories;
};
class Comedy : public Movie {
public:
Comedy();
private:
};
class ComedyFactory : public MovieFactory{
public:
ComedyFactory();
Movie* create() const override{ return new Comedy();};
private:
};
class Drama : public Movie {
public:
private:
};
class DramaFactory : public MovieFactory{
public:
DramaFactory();
Movie* create() const override{ return new Drama();};
private:
};
class Classics : public Movie {
public:
private:
string MajorActorFirst;
string MajorActorLast;
int ReleaseMonth;
};
class ClassicsFactory : public MovieFactory{
public:
ClassicsFactory();
Movie* create() const override{ return new Classics();};
private:
};