#include "UniNeProfessor.h"
#include "UniNeStudent.h"
#include <iostream>
#include <string>

using namespace std;

UniNeProfessor::UniNeProfessor(string name){
    this->name = name;
}

string UniNeProfessor::getName(){
    return this->name;
}


void UniNeProfessor::enregistrerObservateur(Observateur* obs){
    observateurs.push_back(obs);
}
void UniNeProfessor::supprimerObservateur(Observateur* obs){
    observateurs.remove(obs);
}

void UniNeProfessor::notifierObservateurs(string message){
    list<Observateur*>::iterator the_iterator;
  the_iterator = observateurs.begin();
  while( the_iterator != observateurs.end() ) {
    ((UniNeStudent*)(*the_iterator))->actualiser(message,this);
    the_iterator++;
  }

}
void UniNeProfessor::saysToStudents(string s){
    notifierObservateurs(s);
}

void UniNeProfessor::display(){
    cout << "Prof. " << this->name <<endl;
}
