datas.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. //If you don't know what those 2 lines are, you should look for forward declaration
  2. class Student;
  3. class Professor;
  4. /*
  5. You're free to edit those class as much as you like, with the only limitation that the classes must perform the required interactions with one another.
  6. You can change base pointer to smart one.
  7. You can change return type to ... Whatever you like.
  8. Anything, as long as you think it's smarter that what is currently writed in this file.
  9. */
  10. class Course
  11. {
  12. private:
  13. std::string _name;
  14. Professor* _responsable;
  15. std::vector<Student*> _students;
  16. int _numberOfClassToGraduate;
  17. int _maximumNumberOfStudent;
  18. public:
  19. Course(std::string p_name);
  20. void assign(Professor* p_professor);
  21. void subscribe(Student* p_student);
  22. };
  23. class Room
  24. {
  25. private:
  26. long long ID;
  27. std::vector<Person*> _occupants;
  28. public:
  29. Room();
  30. bool canEnter(Person*);
  31. void enter(Person*);
  32. void exit(Person*);
  33. void printOccupant();
  34. };
  35. class Classroom : public Room
  36. {
  37. private:
  38. Course* _currentRoom;
  39. public:
  40. Classroom();
  41. void assignCourse(Course* p_course);
  42. };
  43. class SecretarialOffice: public Room
  44. {
  45. private:
  46. std::vector<Form*> _archivedForms;
  47. public:
  48. };
  49. class HeadmasterOffice : public Room
  50. {
  51. private:
  52. public:
  53. };
  54. class StaffRestRoom : public Room
  55. {
  56. private:
  57. public:
  58. };
  59. class Courtyard : public Room
  60. {
  61. private:
  62. public:
  63. };
  64. class Person
  65. {
  66. private:
  67. std::string _name;
  68. Room* _currentRoom;
  69. public:
  70. Personne(std::string p_name);
  71. Room* room() {return (_currentRoom);}
  72. };
  73. class Staff : public Person
  74. {
  75. private:
  76. public:
  77. void sign(Form* p_form);
  78. };
  79. enum class FormType
  80. {
  81. CourseFinished
  82. NeedMoreClassRoom
  83. NeedCourseCreation
  84. SubscriptionToCourse
  85. };
  86. class Form
  87. {
  88. private:
  89. FormType _formType;
  90. public:
  91. Form(FormType p_formType)
  92. {
  93. }
  94. virtual void execute() = 0;
  95. };
  96. class CourseFinishedForm : public Form
  97. {
  98. private:
  99. public:
  100. void execute();
  101. };
  102. class NeedMoreClassRoomForm : public Form
  103. {
  104. private:
  105. public:
  106. void execute();
  107. };
  108. class NeedCourseCreationForm : public Form
  109. {
  110. private:
  111. public:
  112. void execute();
  113. };
  114. class SubscriptionToCourseForm : public Form
  115. {
  116. private:
  117. public:
  118. void execute();
  119. };
  120. class Student : public Person
  121. {
  122. private:
  123. std::vector<Course*> _subscribedCourse;
  124. public:
  125. void attendClass(Classroom* p_classroom);
  126. void exitClass();
  127. void graduate(Course* p_course);
  128. };
  129. class Headmaster : public Staff
  130. {
  131. private:
  132. std::vector<Form*> _formToValidate;
  133. public:
  134. void receiveForm(Form* p_form);
  135. };
  136. class Secretary : public Staff
  137. {
  138. private:
  139. public:
  140. Form* createForm(FormType p_formType);
  141. void archiveForm();
  142. };
  143. class Professor : public Staff
  144. {
  145. private:
  146. Course* _currentCourse;
  147. public:
  148. void assignCourse(Course* p_course);
  149. void doClass();
  150. void closeCourse();
  151. };
  152. enum class Event
  153. {
  154. RingBell
  155. };