17 this->minutes = minutes;
27 this->hours = std::stoul(time.substr(0, 2));
28 this->minutes = std::stoul(time.substr(3, 5));
39 this->hours = other.hours;
40 this->minutes = other.minutes;
53 return (this->hours == other.hours) && (this->minutes == other.minutes);
65 if (this->hours == other.hours) {
66 return this->minutes < other.minutes;
68 return this->hours < other.hours;
81 return (*
this < other) || (*
this == other);
112 return std::to_string(hours) +
":" + std::to_string(minutes);
124 if (hours >= 0 && hours < 13) {
138 : startTime(startTime), endTime(endTime) {
153 if (this->day != other.day) {
156 if (this->startTime < other.startTime) {
157 return !(this->endTime <= other.startTime);
158 }
else if (this->startTime > other.startTime) {
159 return !(this->startTime >= other.endTime);
181 std::vector<SlotElement> slotElements)
184 this->slotElements = slotElements;
208 for (
unsigned i = 0; i < slotElements.size(); i++) {
209 for (
unsigned j = 0; j < other.slotElements.size(); j++) {
224 slotElements.push_back(slotElement);
266 for (
unsigned i = 0; i < slotElements.size(); i++) {
267 if (!slotElements[i].isMorningSlotElement()) {
bool operator==(const Slot &other)
Checks if two Slot objects are identical, which is if they have the same name.
std::string getTypeName()
Gets the type name, which is "Slot".
MinorType getMinorType()
Gets the minor type of the Course.
std::string getName()
Gets the name of the Slot.
bool operator<=(const Time &)
Checks if a Time is before or identical to another.
bool isMorningTime()
Determines if the Time is a morning time.
bool isIntersecting(Slot &other)
Determines if two Slots are intersecting.
Class for a slot element.
SlotElement(Time &, Time &, Day)
Constructs the SlotElement object.
void addSlotElements(SlotElement)
Adds a slot element to the Slot.
bool operator>=(const Time &)
Checks if a Time is after or identical to another.
bool operator<(const Time &)
Checks if a Time is strictly before another.
bool isMinorSlot()
Determines if the Slot is a minor Slot.
Day
Enum Class to represent a day of the week.
bool isMorningSlotElement()
Determines if the SlotElement is a morning slot element.
FieldType
Enum that represents all the field types.
bool isIntersecting(SlotElement &other)
Determines if two slot elements are intersecting.
bool isMorningSlot()
Determines if the Slot is a morning Slot.
std::string getTimeString()
Gets the time as a string.
FieldType getType()
Gets the type under the FieldType enum.
Slot(std::string, IsMinor, std::vector< SlotElement >)
Constructs the Slot object.
bool operator==(const Time &)
Checks if two Time objects are identical, which is whether they represent the same hours and minutes...
Time(unsigned, unsigned)
Constructs the Time object.
bool operator>(const Time &)
Checks if a Time is strictly after another.
Time & operator=(const Time &)
Assigns a time object to this.