26 lines
1.2 KiB
C#
26 lines
1.2 KiB
C#
namespace SantaClausInc.Core;
|
|
|
|
/// <summary>
|
|
/// Represents information about a child as managed by Santa
|
|
/// </summary>
|
|
/// <param name="Name">Name of the child</param>
|
|
/// <param name="Age">Age of the child</param>
|
|
/// <param name="City">City in which the child lives</param>
|
|
/// <param name="HouseId">Citywide unique ID of the house the child lives in</param>
|
|
/// <param name="GoodOrNaughty">Good or naughty factor of the child</param>
|
|
public record ChildInfo(string Name, int Age, string City, int HouseId, double GoodOrNaughty);
|
|
|
|
/// <summary>
|
|
/// Represents a present for a child
|
|
/// </summary>
|
|
/// <param name="ForChild">Child who will receive the present</param>
|
|
/// <param name="Description">Description of the contained toy</param>
|
|
public record Parcel(ChildInfo ForChild, string Description)
|
|
{
|
|
/// <summary>
|
|
/// Creates a string representation of this <see cref="Parcel" /> containing information about
|
|
/// the child for which it is meant and the content
|
|
/// </summary>
|
|
/// <returns>A string representation of the present</returns>
|
|
public override string ToString() => $"{Description} for {ForChild.Name} (age {ForChild.Age})";
|
|
}
|