diff --git a/BuildingDirectory/BuildingInformation.cs b/BuildingDirectory/BuildingInformation.cs
index 9af78ac..8d83423 100644
--- a/BuildingDirectory/BuildingInformation.cs
+++ b/BuildingDirectory/BuildingInformation.cs
@@ -22,8 +22,7 @@ public sealed class BuildingInformation
/// Returns all floors in the building
///
/// A list of available floors
- // TODO
- public List GetFloorSelection() => new();
+ public List GetFloorSelection() => _companiesPerFloor.GetKeys();
///
/// Returns all companies residing on a specific floor.
@@ -31,8 +30,11 @@ public sealed class BuildingInformation
///
/// The floor to check
/// A list of names of companies residing on the provided floor
- // TODO
- public List? GetCompaniesOnFloor(Floor floor) => null;
+ public List? GetCompaniesOnFloor(Floor floor)
+ {
+ _companiesPerFloor.TryGetValue(floor, out MyDictionary? companies);
+ return companies?.GetKeys();
+ }
///
/// Returns the company identified by floor and company name.
@@ -41,6 +43,13 @@ public sealed class BuildingInformation
/// Floor to look at
/// Name of the requested company
/// Company information if found; null otherwise
- // TODO
- public Company? GetCompany(Floor floor, string companyName) => null;
+ public Company? GetCompany(Floor floor, string companyName)
+ {
+ //Needed to declare here, else you get an initialization error
+ Company? company = null;
+
+ _companiesPerFloor.TryGetValue(floor, out MyDictionary? companies);
+ companies?.TryGetValue(companyName, out company);
+ return company;
+ }
}
\ No newline at end of file