#include "persons.h"
#include <string>

Person::Person(){
    name_="UNKNOWN";
    birth_year_=-1;
}

Person::Person(std::string name, int birthYear){
    name_=name;
    birth_year_=birthYear;
}

bool Person::SetName(std::string name){
    if (name==""){
        return false;
    } else{
        name_=name;
        return true;
    }
}

bool Person::SetBirthYear(int birthYear){
    if (birthYear<1){
        return false;
    }else{
        birth_year_=birthYear;
        return true;
    }
}

//CYCLIST

Cyclist::Cyclist(){
    team_= "UNKNOWN";
    cyclist_id_= "UNKNOWN";
}

Cyclist::Cyclist(std::string name, int birthYear, std::string team, std::string cyclistId):Person(name,birthYear){   
    team_=team;
    cyclist_id_=cyclistId;
} 

bool Cyclist::SetTeam(std::string team){
    if (team==""){
        return false;
    }else{
        team_=team;
        return true;
    }
}

bool Cyclist::SetCyclistId(std::string cyclistId){
    if (cyclistId==""){
        return false;
    }else{
        cyclist_id_=cyclistId;
        return true;
    }
}

//DIRECTOR

Director::Director(){
    team_= "UNKNOWN";
    uci_license_= "UNKNOWN";
    director_since_=-1;
}

Director::Director(std::string name, int birthYear, std::string team, std::string uciLicense, int directorSince):Person(name,birthYear){   
    team_=team;
    uci_license_=uciLicense ;
    director_since_=directorSince;
} 

bool Director::SetTeam(std::string team){
    if (team==""){
        return false;
    }else{
        team_=team;
        return true;
    }
}

bool Director::SetUciLicenseId(std::string uciLicense){
    if (uciLicense==""){
        return false;
    }else{
        uci_license_=uciLicense;
        return true;
    }
}

bool Director::SetDirectorSince(int directorSince){
    if (directorSince<1){
        return false;
    }else{
        director_since_=directorSince;
        return true;
    }
}

