Implemented Package.cs

This commit is contained in:
MarcUs7i 2025-05-09 10:25:33 +02:00
parent a7d1595fae
commit 72d1ce88be

View file

@ -17,26 +17,26 @@ public sealed class Package : IMeasuredBox
public int Width
{
get => _width;
init => _width = -1; // TODO
init => _width = SanitizeValue(value);
}
public int Height
{
get => _height;
init => _height = -1; // TODO
init => _height = SanitizeValue(value);
}
public int Depth
{
get => _depth;
init => _depth = -1; // TODO
init => _depth = SanitizeValue(value);
}
public double Weight
{
get => _weight;
init => _weight = -1D; // TODO
init => _weight = SanitizeValue(value);
}
private static T SanitizeValue<T>(T value) where T : INumber<T> => default!; // TODO
private static T SanitizeValue<T>(T value) where T : INumber<T> => value > T.Zero ? value : T.Zero;
}