Commit dd890c68 authored by Francois Foltete's avatar Francois Foltete
Browse files

Merge branch 'master' of git.unistra.fr:barre-oblique-v3/t432_sab20_t3_b

parents 3a1bcae4 c4f5cfe3
......@@ -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;
......@@ -40,21 +37,6 @@ class Student : public Actor {
*/
Student(const std::string &firstname, const std::string &surname,
double mood, double motivation, double skill, const std::string &texturePath);
~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