Skip to content

Commit fa29a3c

Browse files
authored
Merge pull request #14 from synercoder/develop
Added Value.Zero
2 parents fce98a6 + 6a06272 commit fa29a3c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Synercoding.Primitives/PackageDetails.props

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
<Product>Synercoding.Primitives</Product>
1111
<Title>Synercoding.Primitives</Title>
1212
<Description>Primitives with types attached (think mm, cm, in, px) that can be used for 2D graphics.</Description>
13-
<PackageReleaseNotes>- Removed implicit double conversion, to easy to make a mistake with the wrong unit type
14-
- Added equality and inequality operators to all structs
15-
- Added multiple target-frameworks
16-
- Added multiplication operator for Value on other side
17-
- Renamed UnitValue to Value
18-
- Fixed a few nullability warnings</PackageReleaseNotes>
13+
<PackageReleaseNotes>- Added Value.Zero</PackageReleaseNotes>
1914
</PropertyGroup>
2015

2116
</Project>

src/Synercoding.Primitives/Value.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ public override bool Equals(object? obj)
8181
public bool Equals(Value other)
8282
=> CompareTo(other) == 0;
8383

84+
/// <summary>
85+
/// Represents a value of zero
86+
/// </summary>
87+
public static Value Zero => new Value(0, Unit.Inches);
88+
8489
/// <summary>
8590
/// Returns a value that indicates whether two specified <see cref="Value"/> values are equal.
8691
/// </summary>

0 commit comments

Comments
 (0)