forked from CodeWithKartik/BookMyShow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Movie.h
55 lines (48 loc) · 1.47 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
#ifndef MOVIE_H_INCLUDED
#define MOVIE_H_INCLUDED
#include <iostream>
#include <vector>
#include <cstring>
enum MovieType {
U = 0,
A,
UA,
MTCOUNT
};
typedef unsigned long int ULI;
class Movie {
protected:
ULI movieID;
const char *name;
char *language;
int relDate[8];
MovieType category;
std::vector<ULI> inCinemas;
public:
Movie(const char *mname, char *lang, MovieType cat);
Movie(const Movie &cpy);
~Movie();
//Getters
const ULI GetID() const {return movieID;}
const char *GetName() const {return name;}
const char *GetLanguage() const {return language;}
const int *GetRelDate() const {return relDate;}
const MovieType GetCategory() const {return category;}
const std::vector<ULI> GetCinemaList() const {return inCinemas;}
//Setters
void SetMovieID(const ULI id) {movieID = id;}
void SetLanguage(char *lang) {
language = new char[strlen(lang)+1];
strcpy(language, lang);
}
void SetRelDate(int relDt[]) {
for (register int i = 0; i < 8; i++)
relDate[i] = relDt[i];
}
void SetCategory(MovieType cat) {category = cat;}
void SetCinemaList(std::vector<ULI> cineLst) {inCinemas = cineLst;}
friend std::ostream& operator<<(std::ostream& os, const Movie *mv);
//void UpdateMovieInformation(ULI id, char *lang, int rDate[], MovieType cat);
//void UpdatePlayingInCinemasList(ULI id, std::vector<ULI> inCinemas);
};
#endif // MOVIE_H_INCLUDED