Timetabler
classroom.cpp
1 #include "fields/classroom.h"
2 
3 #include <string>
4 #include "global.h"
5 
12 Classroom::Classroom(std::string number, unsigned size) {
13  this->number = number;
14  this->size = size;
15 }
16 
26 bool Classroom::operator==(const Classroom &other) {
27  return (this->number == other.number);
28 }
29 
38 bool Classroom::sizeLessThan(const Classroom &other) {
39  return (this->size < other.size);
40 }
41 
47 FieldType Classroom::getType() { return FieldType::classroom; }
48 
54 std::string Classroom::getTypeName() { return "Classroom"; }
55 
61 std::string Classroom::getName() { return number; }
62 
68 unsigned Classroom::getSize() { return size; }
Class for a classroom.
Definition: classroom.h:13
std::string getTypeName()
Gets the type name, which is "Classroom".
Definition: classroom.cpp:54
FieldType
Enum that represents all the field types.
Definition: global.h:9
bool sizeLessThan(const Classroom &other)
Checks if the size of this Classroom is less than the size of another.
Definition: classroom.cpp:38
Classroom(std::string, unsigned)
Constructs the object.
Definition: classroom.cpp:12
bool operator==(const Classroom &other)
Overloads the == operator to check for equality.
Definition: classroom.cpp:26
unsigned getSize()
Gets the size of the Classroom.
Definition: classroom.cpp:68
FieldType getType()
Gets the type under the FieldType enum.
Definition: classroom.cpp:47
std::string getName()
Gets the class number of the Classroom.
Definition: classroom.cpp:61