Timetabler
is_minor.cpp
1 #include "fields/is_minor.h"
2 
3 #include <string>
4 #include "global.h"
5 
11 IsMinor::IsMinor(MinorType minorType) { this->minorType = minorType; }
12 
18 IsMinor::IsMinor(bool isMinor) {
19  if (isMinor) {
20  this->minorType = MinorType::isMinorCourse;
21  } else {
22  this->minorType = MinorType::isNotMinorCourse;
23  }
24 }
25 
31 FieldType IsMinor::getType() { return FieldType::isMinor; }
32 
38 MinorType IsMinor::getMinorType() { return minorType; }
39 
45 std::string IsMinor::getTypeName() { return "Minor Type"; }
46 
52 std::string IsMinor::getName() {
53  if (minorType == MinorType::isMinorCourse) {
54  return "Yes";
55  }
56  return "No";
57 }
IsMinor(MinorType)
Constructs the IsMinor object.
Definition: is_minor.cpp:11
MinorType getMinorType()
Gets the minor type of the Course.
Definition: is_minor.cpp:38
FieldType getType()
Gets the type under the FieldType enum.
Definition: is_minor.cpp:31
MinorType
Enum to represent the types of "Is Minor".
Definition: is_minor.h:16
std::string getName()
Gets whether the Course is a minor course or not.
Definition: is_minor.cpp:52
FieldType
Enum that represents all the field types.
Definition: global.h:9
std::string getTypeName()
Gets the type name, which is "Minor Type".
Definition: is_minor.cpp:45