From b844597fd23bc57aa97e231fc90eecfd6322cecc Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 7 May 2022 08:28:27 +0300 Subject: Reorganized whole architecture --- src/EventSystem/Ticket.cpp | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 src/EventSystem/Ticket.cpp (limited to 'src/EventSystem/Ticket.cpp') diff --git a/src/EventSystem/Ticket.cpp b/src/EventSystem/Ticket.cpp deleted file mode 100644 index e37cccf..0000000 --- a/src/EventSystem/Ticket.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include "Ticket.h" - -Ticket::Ticket() : Ticket(0, 0) {} - -Ticket::Ticket(unsigned row, unsigned seat) { - this->row = row; - this->seat = seat; -} - -unsigned Ticket::get_row() const { - return row; -} - -unsigned Ticket::get_seat() const { - return seat; -} - -void Ticket::read(std::istream& istr) { - istr.read((char*)&row, sizeof(row)); - istr.read((char*)&row, sizeof(seat)); -} - -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) - (seat < other.seat); - return (row > other.row) - (row < other.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(); -} -- cgit v1.3.1-23-gd82d