Implemented Package.cs
This commit is contained in:
parent
a7d1595fae
commit
72d1ce88be
1 changed files with 6 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue