SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Add operator overloads for version

Pathoschild opened this issue ยท 1 comments

commented

The Version class already implements IComparable<Version>, so you can compare two semantic versions using version.CompareTo(other) > 1. Add operator overloads so you can do version > other too.

commented

Migrating SMAPI's API surface to interfaces (instead of returning concrete implementations which limit our ability to refactor internally) is one of the long-term goals. Turns out you can't add operator overloads to an interface, so this isn't compatible with the roadmap.

Instead I'll add version.IsNewerThan(other) and version.IsOlderThan(other) separately for convenience.

Closed as won't fix.