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

SimpleEvent::SimpleEvent(unsigned startTime, unsigned endTime) : Event(0, 0) {
	if (endTime - startTime <= 120) {
		Event::setStartTime(startTime);
		Event::setEndTime(endTime);
	}
	else
		std::cout << "Event cannot last for more than 2 hours (120 minutes)!" << std::endl;
}

SimpleEvent* SimpleEvent::clone() const {
	return new SimpleEvent(*this);
}