Website Summary Files Commits Branches @commit @diff @stats
path: root / src / EventSystem / Ticket.cpp
diff options
context:
space:
mode:
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();
+}