#include "Student.h"

Student::Student(std::string lastName, std::string firstName) : lastName(lastName), firstName(firstName),
                                                                matriculationNumber(generateMatriculationNumber()) {
    nextStudent = nullptr;
    previousStudent = nullptr;
}

std::string Student::getLastName() const {
    return lastName;
}

std::string Student::getFirstName() const {
    return firstName;
}

int Student::getMatriculationNumber() const {
    return matriculationNumber;
}

Student *Student::getNextStudent() const {
    return nextStudent;
}

void Student::setNextStudent(Student *nextStudent) {
    this->nextStudent = nextStudent;
}

Student *Student::getPreviousStudent() const {
    return previousStudent;
}

void Student::setPreviousStudent(Student *previousStudent) {
    this->previousStudent = previousStudent;
}

int Student::generateMatriculationNumber() {
    // Generate the matriculation number starting from 1000000 and counting up.
    static int matriculationNumber = 1000000;
    return matriculationNumber++;
}