Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 / ex2 / Event.cpp
blob: 90c3740e32d1bc52cb21ec489ed2ff3fa1112ac1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Event.h"

void Event::setStartTime(unsigned startTime) {
	this->startTime = startTime;
}

void Event::setEndTime(unsigned endTime) {
	this->endTime = endTime;
}

Event::Event(unsigned startTime, unsigned endTime) {
	setStartTime(startTime);
	setEndTime(endTime);
}

bool Event::isHappeningAt(unsigned time) const {
	return time >= startTime && time <= endTime;
}