Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / Ticket.cpp
diff options
context:
space:
mode:
Commitad78d67f131cc4e8ea158ecf01321cd498e72b56 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 20:18:50 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-05 20:18:50 +0300
Files021100e5e05f1d3c847eaf4030f4e36a8de211b3 /src/EventSystem/Ticket.cpp
FMI-OOP-P1_TicketSystem-ad78d67f131cc4e8ea158ecf01321cd498e72b56.tar
FMI-OOP-P1_TicketSystem-ad78d67f131cc4e8ea158ecf01321cd498e72b56.tar.gz
FMI-OOP-P1_TicketSystem-ad78d67f131cc4e8ea158ecf01321cd498e72b56.zip
Parentb300191570fd24fd374360be1b0e4c9a4598a0f2 (diff)
Autocommit at 05.05.2022 @ 20:18
1 files changed, 13 insertions, 0 deletions
-rw-r--r--src/EventSystem/Ticket.cpp13
diff --git a/src/EventSystem/Ticket.cpp b/src/EventSystem/Ticket.cpp
index 0199654..997045e 100644
--- a/src/EventSystem/Ticket.cpp
+++ b/src/EventSystem/Ticket.cpp
@@ -30,3 +30,16 @@ int Ticket::compare(const Ticket& other) const {
return (seat > other.seat) - (other.seat < seat);
return (row > other.row) - (other.row < row);
}
+
+/* General */
+
+std::istream& operator>>(std::istream& istr, Ticket& ticket) {
+ unsigned row, seat;
+ istr >> row >> seat;
+ ticket = Ticket(row, seat);
+ return istr;
+}
+
+std::ostream& operator<<(std::ostream& ostr, const Ticket& ticket) {
+ return ostr << ticket.get_row() << " " << ticket.get_seat();
+}