Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models / Event.cpp
diff options
context:
space:
mode:
Commit45f1bf728d1a0bdf21e657687d1d86d37abd5c8f (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 16:58:55 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-07 16:58:55 +0300
Files67187fced6b621cf025959a2e7c45fc88db02c1d /src/Models/Event.cpp
FMI-OOP-P1_TicketSystem-45f1bf728d1a0bdf21e657687d1d86d37abd5c8f.tar
FMI-OOP-P1_TicketSystem-45f1bf728d1a0bdf21e657687d1d86d37abd5c8f.tar.gz
FMI-OOP-P1_TicketSystem-45f1bf728d1a0bdf21e657687d1d86d37abd5c8f.zip
Parent76dae1e6fef3641ab9967d6307c20d4aa9719408 (diff)
Autocommit at 07.05.2022 @ 16:58
1 files changed, 5 insertions, 5 deletions
-rw-r--r--src/Models/Event.cpp10
diff --git a/src/Models/Event.cpp b/src/Models/Event.cpp
index 18d0f91..b2b1e01 100644
--- a/src/Models/Event.cpp
+++ b/src/Models/Event.cpp
@@ -4,7 +4,7 @@
Event::Event() : hall(), name(), date() {}
Event::Event(const Hall& hall, String name, Date date) : tickets(), reservations() {
- this->hall = &hall;
+ this->hall = hall;
this->name = name;
this->date = date;
}
@@ -18,7 +18,7 @@ OrderedList<Reservation>& Event::get_reservations() {
}
const Hall& Event::get_hall() const {
- return *hall;
+ return hall;
}
const String& Event::get_name() const {
@@ -30,7 +30,7 @@ const Date& Event::get_date() const {
}
void Event::read(std::istream& istr) {
- istr.read(istr.hall, sizeof(hall));
+ hall.read(istr);
name.read(istr);
date.read(istr);
tickets.read(istr);
@@ -46,9 +46,9 @@ void Event::write(std::ostream& ostr) {
}
int Event::compare(const Event& other) {
- if (hall == other.hall)
+ if (hall.compare(other.hall) == 0)
return date.compare(other.date);
- return hall->compare(*other.hall);
+ return hall.compare(other.hall);
}
std::istream& operator>>(std::istream& istr, Event& event) {