-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
105 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
namespace Sucrose.Shared.Space.Helper | ||
{ | ||
internal static class Versionly | ||
{ | ||
public static Version Increment(Version Version) | ||
{ | ||
try | ||
{ | ||
int Major = Version.Major; | ||
int Minor = Version.Minor; | ||
int Build = Version.Build; | ||
int Revision = Version.Revision + 1; | ||
|
||
if (Revision > 9) | ||
{ | ||
Revision = 0; | ||
Build++; | ||
} | ||
|
||
if (Build > 9) | ||
{ | ||
Build = 0; | ||
Minor++; | ||
} | ||
|
||
if (Minor > 9) | ||
{ | ||
Minor = 0; | ||
Major++; | ||
} | ||
|
||
return new Version(Major, Minor, Build, Revision); | ||
} | ||
catch | ||
{ | ||
return new Version(0, 0, 0, 0); | ||
} | ||
} | ||
|
||
public static Version Decrement(Version Version) | ||
{ | ||
try | ||
{ | ||
int Major = Version.Major; | ||
int Minor = Version.Minor; | ||
int Build = Version.Build; | ||
int Revision = Version.Revision - 1; | ||
|
||
if (Revision < 0) | ||
{ | ||
Revision = 9; | ||
Build--; | ||
} | ||
|
||
if (Build < 0) | ||
{ | ||
Build = 9; | ||
Minor--; | ||
} | ||
|
||
if (Minor < 0) | ||
{ | ||
Minor = 9; | ||
Major--; | ||
} | ||
|
||
return new Version(Major, Minor, Build, Revision); | ||
} | ||
catch | ||
{ | ||
return new Version(0, 0, 0, 0); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters