Implemented AskForRoom() and NoOfEmployees in Company.cs

This commit is contained in:
MarcUs7i 2025-01-20 20:55:43 +01:00
parent cb34bde971
commit d2c41943f6

View file

@ -28,8 +28,7 @@ public sealed class Company
/// <summary>
/// Gets the number of employees working for the company
/// </summary>
// TODO
public int NoOfEmployees => -1;
public int NoOfEmployees => _employeeRooms.Count;
/// <summary>
/// Returns the room number the clerk identified by the provided
@ -39,8 +38,8 @@ public sealed class Company
/// <returns>Room number if found; null otherwise</returns>
public int? AskForRoom(BusinessCard businessCard)
{
// TODO
return -1;
bool found = _employeeRooms.TryGetValue(businessCard, out int room);
return found ? room : null;
}
}