-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMovie.cpp
More file actions
32 lines (24 loc) · 684 Bytes
/
Movie.cpp
File metadata and controls
32 lines (24 loc) · 684 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
#include "Movie.h"
Movie::Movie(const std::string& title, int duration)
: title(title), durationMinutes(duration) {}
std::string Movie::getTitle() const {
return title;
}
int Movie::getDurationMinutes() const {
return durationMinutes;
}
int Movie::getSessionCount() const {
return schedule.count();
}
int Movie::getTotalDuration() const {
return getSessionCount() * durationMinutes;
}
void Movie::addSessionToSchedule(const std::tm& dateTime) {
schedule.addSession(dateTime);
}
void Movie::removeSessionAt(int index) {
schedule.removeSessionAt(index);
}
std::vector<std::tm> Movie::getSessionTimes() const {
return schedule.getAllSessions();
}