Website Summary Files Commits Branches @commit @diff @stats
path: root / src / Models
diff options
context:
space:
mode:
2 files changed, 10 insertions, 5 deletions
-rw-r--r--src/Models/Event.cpp13
-rw-r--r--src/Models/Event.h2
diff --git a/src/Models/Event.cpp b/src/Models/Event.cpp
index afb8790..ca9d830 100644
--- a/src/Models/Event.cpp
+++ b/src/Models/Event.cpp
@@ -74,16 +74,21 @@ std::istream& operator>>(std::istream& istr, Event& event) {
return istr;
}
-unsigned char insertionOpSet = 0;
+unsigned insertionOpSet = 0;
-void configureInsertionOperator(unsigned char setting) {
- if (setting > 7) setting = 7;
+void configureEventInsertionOp(unsigned setting) {
insertionOpSet = setting;
}
std::ostream& operator<<(std::ostream& ostr, const Event& event) {
if (insertionOpSet & 1) {
- ostr << "| Hall: " << event.get_hall().get_number() << " | Name: " << event.get_name() << " | Date: " << event.get_date() << std::endl;
+ ostr << "| Hall: " << event.get_hall().get_number() << " | Name: " << event.get_name() << " | Date: " << event.get_date();
+
+ if (insertionOpSet & 8)
+ ostr << " || Tickets Count: " << event.get_tickets().get_count();
+ if (insertionOpSet & 16)
+ ostr << " || Reservations Count: " << event.get_reservations().get_count();
+ ostr << std::endl;
}
if (insertionOpSet & 2) {
ostr << "Bought tickets: ";
diff --git a/src/Models/Event.h b/src/Models/Event.h
index 57ff93a..f22e54c 100644
--- a/src/Models/Event.h
+++ b/src/Models/Event.h
@@ -37,7 +37,7 @@ public:
};
std::istream& operator>>(std::istream& istr, Event& event);
-void configureInsertionOperator(unsigned char setting);
+void configureEventInsertionOp(unsigned setting);
std::ostream& operator<<(std::ostream& ostr, const Event& event);
#endif