Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Exam 2 / ex2 / Event.h
diff options
context:
space:
mode:
1 files changed, 20 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Exam 2/ex2/Event.h20
diff --git a/Year 1/Object-oriented Programming/Exam 2/ex2/Event.h b/Year 1/Object-oriented Programming/Exam 2/ex2/Event.h
new file mode 100644
index 0000000..a02f60c
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Exam 2/ex2/Event.h
@@ -0,0 +1,20 @@
+#ifndef HEADER_EVENT
+#define HEADER_EVENT
+
+class Event {
+ unsigned startTime;
+ unsigned endTime;
+
+protected:
+ void setStartTime(unsigned startTime);
+ void setEndTime(unsigned endTime);
+
+public:
+ Event(unsigned startTime, unsigned endTime);
+ virtual bool isHappeningAt(unsigned time) const;
+
+ virtual Event* clone() const = 0;
+ virtual ~Event() = default;
+};
+
+#endif