-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeries.cpp
More file actions
62 lines (56 loc) · 1.65 KB
/
Copy pathSeries.cpp
File metadata and controls
62 lines (56 loc) · 1.65 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
/*
* Streaming Service Modeling Proyect
* Rommel T.
*/
/*
* Definition of Series class
*/
#include "Series.h"
/**
* Constructor for the Series class.
* @param string id_: the ID of the series
* string name_: the name of the series
* int length_: the length of the series
* string genres_: the genres of the series
* int rating_: the rating of the series
* @return Series object
*/
Series::Series(string id_, string name_, int length_, string genres_, int rating_):Video("SS" + id_, name_, length_, genres_, rating_){
setId(id_);
setName(name_);
setLength(length_);
setGenre(genres_);
setRating(rating_);
}
/**
* Sets the ID of the series.
* @param string id: the ID of the series
* @return
*/
void Series::setId(string id){
this->id = "SRS" + id;
}
/**
* Sets the season information for the series.
* @param string id: the ID of the season
* string title: the title of the season
* vector<string*> ids: the IDs of the episodes in the season
* vector<string*> names: the names of the episodes in the season
* vector<int*> lengths: the lengths of the episodes in the season
* vector<int*> ratings: the ratings of the episodes in the season
* @return
*/
void Series::setSeason(string id, string title, vector<string*> ids, vector<string*> names, vector<int*> lengths, vector<int*> ratings){
seasons.push_back(new Season(id, title));
for(int i = 0; i < ids.size(); i++){
seasons.back()->setEpisode(*ids[i], *names[i], *lengths[i], *ratings[i]);
}
}
/**
* Retrieves the seasons of the series.
* @param
* @return vector<Season*>: the seasons of the series
*/
vector<Season*> Series::getSeasons(){
return seasons;
}