ex-col-04-training/waiting_room/WaitingRoom/WaitingRoom.cs
github-classroom[bot] 3723fffef2
Initial commit
2025-01-02 16:34:36 +00:00

65 lines
No EOL
2.1 KiB
C#

namespace WaitingRoom;
/// <summary>
/// Represents the waiting room at a doctor's office.
/// Keeps an emergency and a normal waiting queue.
/// Emergency patients are treated first; patients within the same queue are
/// treated according to their arrival time.
/// </summary>
public sealed class WaitingRoom
{
private readonly PatientQueue _emergencyQueue = new();
private readonly PatientQueue _normalQueue = new();
/// <summary>
/// Gets the current number of emergency patients waiting
/// </summary>
// TODO
public int CountEmergency => -1;
/// <summary>
/// Gets the current number of normal patients waiting
/// </summary>
// TODO
public int CountNormal => -1;
/// <summary>
/// Gets the current number of all patients waiting
/// </summary>
// TODO
public int CountAll => -1;
/// <summary>
/// Creates a string representation of the waiting room, showing statistics
/// about waiting patients
/// </summary>
/// <returns>String representation of the waiting room</returns>
public override string ToString() => $"{CountEmergency} Emergency {CountNormal} Normal";
/// <summary>
/// Admits a new patient to the waiting room.
/// Patient will be added to either the normal or the emergency queue, depending on its state.
/// </summary>
/// <param name="patient">Patient to admit</param>
public void AddPatient(Patient patient)
{
// TODO
}
/// <summary>
/// Returns the next patient to be treated, removing it from its waiting queue
/// </summary>
/// <returns>Next patient to treat, if any</returns>
// TODO
public Patient? Next() => null;
/// <summary>
/// Promotes a patient to be an emergency case.
/// The patient has to be moved from the normal to the emergency queue.
/// </summary>
/// <param name="patient">Patient to declare an emergency for</param>
public void SetPatientToEmergency(Patient patient)
{
// TODO
}
}