// Teller.cpp      Dave Reed      davereed@creighton.edu
///////////////////////////////////////////////////////////


#include "Teller.h"

Teller::Teller(int id) 
{
    tellerID = id;
    busyUntil = 0;
}

int Teller::getID()
{
    return tellerID;
}

Status Teller::getStatus(int currentTime)
{
    if (currentTime < busyUntil) {
        return BUSY;
    }
    else if (currentTime == busyUntil) {
        return FINISHED;
    }
    else {
        return FREE;
    }
}

void Teller::serveCustomer(Customer c, int currentTime)
{
    serving = c;
    busyUntil = currentTime + c.getJobLength();
}

Customer Teller::getCurrentCustomer(int currentTime)
{
    return serving;
}