diff options
| author | Physcik <mynameisgennadiy@vk.com> | 2026-01-10 17:27:55 +0500 |
|---|---|---|
| committer | Physcik <mynameisgennadiy@vk.com> | 2026-01-10 17:27:55 +0500 |
| commit | a364d4330dfd34f953f64e90020f8b8d6f2e82c4 (patch) | |
| tree | db71d125f633832b130821f3aec07d4b714ab7bb /engine/Settings/AppVersion.go | |
| parent | e6ccb74f77d0d03d33c422ca7dc942422074d7dd (diff) | |
World storage system change
Diffstat (limited to 'engine/Settings/AppVersion.go')
| -rw-r--r-- | engine/Settings/AppVersion.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engine/Settings/AppVersion.go b/engine/Settings/AppVersion.go new file mode 100644 index 0000000..d21fd1a --- /dev/null +++ b/engine/Settings/AppVersion.go @@ -0,0 +1,24 @@ +package settings + +type AppVersion struct { + MajorVersion uint + MinorVersion uint + Patch uint + IsBeta bool +} + +func (base *AppVersion) IsGreaterThan(other *AppVersion) bool { + return base.MajorVersion > other.MajorVersion || base.MinorVersion > other.MinorVersion || base.Patch > other.Patch +} + +func (base *AppVersion) IsEqualTo(other *AppVersion) bool { + return base.MajorVersion == other.MajorVersion && base.MinorVersion == other.MinorVersion && base.Patch == other.Patch +} + +func (base *AppVersion) IsLessThan(other *AppVersion) bool { + return base.MajorVersion < other.MajorVersion && base.MinorVersion < other.MinorVersion && base.Patch < other.Patch +} + +func (base *AppVersion) IsCompatible() bool { + return Current.Version.MajorVersion >= base.MajorVersion && Current.Version.MinorVersion >= base.MinorVersion && Current.Version.Patch >= base.Patch +} |
