mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 00:50:25 +02:00
Moving corlib files out of "System" directory into root
This commit is contained in:
parent
4cd58262e4
commit
7dbfd15292
179 changed files with 3 additions and 0 deletions
53
BeefLibs/corlib/src/Version.bf
Normal file
53
BeefLibs/corlib/src/Version.bf
Normal file
|
@ -0,0 +1,53 @@
|
|||
namespace System
|
||||
{
|
||||
struct Version
|
||||
{
|
||||
public int32 Major;
|
||||
public int32 Minor;
|
||||
public int32 Build = -1;
|
||||
public int32 Revision = -1;
|
||||
|
||||
public this(int32 major, int32 minor)
|
||||
{
|
||||
Major = major;
|
||||
Minor = minor;
|
||||
}
|
||||
|
||||
public this(int32 major, int32 minor, int32 build, int32 revision)
|
||||
{
|
||||
Major = major;
|
||||
Minor = minor;
|
||||
Build = build;
|
||||
Revision = revision;
|
||||
}
|
||||
|
||||
public static int operator<=>(Version lhs, Version rhs)
|
||||
{
|
||||
if (lhs.Major != rhs.Major)
|
||||
if (lhs.Major > rhs.Major)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (lhs.Minor != rhs.Minor)
|
||||
if (lhs.Minor > rhs.Minor)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (lhs.Build != rhs.Build)
|
||||
if (lhs.Build > rhs.Build)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
if (lhs.Revision != rhs.Revision)
|
||||
if (lhs.Revision > rhs.Revision)
|
||||
return 1;
|
||||
else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue