Commit c4f5cfe3 authored by Elias Leinenweber's avatar Elias Leinenweber
Browse files

Mise en page de l'affichage de la classe

parent df865711
......@@ -12,9 +12,6 @@ class Classroom;
class Student : public Actor {
private:
/** @brief Classe de l'élève */
Classroom *classroom;
/** @brief Notes de l'élève */
std::map<Subject *, std::vector<double>> grades;
......@@ -39,21 +36,6 @@ class Student : public Actor {
*/
Student(const std::string &firstname, const std::string &surname,
double mood, double motivation, double skill);
~Student();
/**
* @brief Retourne l'objet classroom
*
* @return Classroom Classe de l'élève
*/
Classroom *getClassroom() { return classroom; }
/**
* @brief Set l'objet classroom
*
* @param classroom Classe de l'élève
*/
void setClassroom(Classroom *classroom) { this->classroom = classroom; }
/**
* @brief Get l'humeur de l'élève
......
......@@ -44,10 +44,13 @@ Classroom::render() const
ImVec2(ImGui::GetWindowPos().x + ImGui::GetContentRegionAvail().x,
ImGui::GetWindowPos().y + ImGui::GetContentRegionAvail().y));
ImGui::SameLine();
ImGui::Dummy(ImVec2(0., 120.));
teacher->render();
ImGui::SameLine();
ImGui::Dummy(ImVec2(100., 20.));
for (const Student *student : students) {
student->render();
ImGui::SameLine();
student->render();
}
}
ImGui::EndChild();
......
......@@ -16,15 +16,8 @@ Student::Student(const std::string &firstname, const std::string &surname,
void
Student::addGrades(Subject *subject, double grade)
{
if (grades.count(subject) > 0) { // subject already in the map
if (grades.count(subject) > 0)
grades.at(subject).push_back(grade);
} else {
std::vector<double> gr;
grades.emplace(subject, gr);
}
}
Student::~Student()
{
// todo
else
grades.emplace(subject, std::vector<double>());
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment