Initial commit

This commit is contained in:
github-classroom[bot] 2025-01-02 16:52:58 +00:00 committed by GitHub
commit eab553c714
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 5080 additions and 0 deletions

View file

@ -0,0 +1,65 @@
namespace BuildingDirectory.Model;
/// <summary>
/// Represents a business card of a company employee
/// </summary>
public sealed class BusinessCard
{
/// <summary>
/// Creates a new instance of a business card
/// </summary>
/// <param name="firstName">First name of the employee</param>
/// <param name="lastName">Last name of the employee</param>
/// <param name="department">Department the employee works at</param>
/// <param name="phoneNumber">Phone number of the employee</param>
/// <param name="eMail">E-Mail address of the employee</param>
public BusinessCard(string firstName, string lastName, string department, string? phoneNumber, string eMail)
{
FirstName = firstName;
LastName = lastName;
Department = department;
PhoneNumber = phoneNumber;
EMail = eMail;
}
/// <summary>
/// Gets the first name of the employee
/// </summary>
public string FirstName { get; }
/// <summary>
/// Gets the last name of the employee
/// </summary>
public string LastName { get; }
/// <summary>
/// Gets the name of the department the employee works at
/// </summary>
public string Department { get; }
/// <summary>
/// Gets the phone number of the employee
/// </summary>
public string? PhoneNumber { get; }
/// <summary>
/// Gets the E-Mail address of the employee
/// </summary>
public string EMail { get; }
/// <summary>
/// Determines if this object is equal to another
/// </summary>
/// <param name="obj">Other object to compare to</param>
/// <returns>True if the objects are equal; false otherwise</returns>
// TODO
public override bool Equals(object? obj)
=> false;
/// <summary>
/// Calculates the hash code for this object
/// </summary>
/// <returns>Numeric hash code</returns>
// TODO
public override int GetHashCode() => -1;
}

View file

@ -0,0 +1,46 @@
namespace BuildingDirectory.Model;
/// <summary>
/// Represents a company with employees
/// </summary>
public sealed class Company
{
private readonly MyDictionary<BusinessCard, int> _employeeRooms;
/// <summary>
/// Creates a new instance of a company with the given name and the employees together
/// with their room numbers.
/// Employees are represented/identified by their <see cref="BusinessCard"/>
/// </summary>
/// <param name="employeeRooms">Employees and assigned room numbers</param>
/// <param name="name">Name of the company</param>
public Company(MyDictionary<BusinessCard, int> employeeRooms, string name)
{
_employeeRooms = employeeRooms;
Name = name;
}
/// <summary>
/// Gets the name of the company
/// </summary>
public string Name { get; }
/// <summary>
/// Gets the number of employees working for the company
/// </summary>
// TODO
public int NoOfEmployees => -1;
/// <summary>
/// Returns the room number the clerk identified by the provided
/// <see cref="BusinessCard"/> resides at - if known
/// </summary>
/// <param name="businessCard">Identification of the employee</param>
/// <returns>Room number if found; null otherwise</returns>
public int? AskForRoom(BusinessCard businessCard)
{
// TODO
return -1;
}
}

View file

@ -0,0 +1,12 @@
namespace BuildingDirectory.Model;
/// <summary>
/// Represents a floor in a building
/// </summary>
public enum Floor
{
Ground,
First,
Second,
Third
}