Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / Ticket.cpp
diff options
context:
space:
mode:
Commitac0e4ab43c93d4c886a8c33a491b79c858080b3d (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-02 21:45:38 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-02 21:45:38 +0300
Files426883302223b5b6623a39e3d9c38ae9f7281c63 /src/EventSystem/Ticket.cpp
FMI-OOP-P1_TicketSystem-ac0e4ab43c93d4c886a8c33a491b79c858080b3d.tar
FMI-OOP-P1_TicketSystem-ac0e4ab43c93d4c886a8c33a491b79c858080b3d.tar.gz
FMI-OOP-P1_TicketSystem-ac0e4ab43c93d4c886a8c33a491b79c858080b3d.zip
Parent0521180c61e7d8970f164f3154599e49800e85c6 (diff)
Autocommit at 02.05.2022 @ 21:45
1 files changed, 6 insertions, 0 deletions
-rw-r--r--src/EventSystem/Ticket.cpp6
diff --git a/src/EventSystem/Ticket.cpp b/src/EventSystem/Ticket.cpp
index 70463db..0199654 100644
--- a/src/EventSystem/Ticket.cpp
+++ b/src/EventSystem/Ticket.cpp
@@ -24,3 +24,9 @@ void Ticket::write(std::ostream& ostr) const {
ostr.write((const char*)&row, sizeof(row));
ostr.write((const char*)&seat, sizeof(seat));
}
+
+int Ticket::compare(const Ticket& other) const {
+ if (row == other.row)
+ return (seat > other.seat) - (other.seat < seat);
+ return (row > other.row) - (other.row < row);
+}