From a364d4330dfd34f953f64e90020f8b8d6f2e82c4 Mon Sep 17 00:00:00 2001 From: Physcik Date: Sat, 10 Jan 2026 17:27:55 +0500 Subject: World storage system change --- engine/Settings/AppVersion.go | 24 ++++++++++++++++++++++++ engine/Settings/Settings.go | 7 ------- 2 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 engine/Settings/AppVersion.go (limited to 'engine/Settings') 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 +} diff --git a/engine/Settings/Settings.go b/engine/Settings/Settings.go index a0490cc..f943203 100644 --- a/engine/Settings/Settings.go +++ b/engine/Settings/Settings.go @@ -6,13 +6,6 @@ import ( "os" ) -type AppVersion struct { - MajorVersion uint - MinorVersion uint - Patch uint - IsBeta bool -} - type Settings struct { Version AppVersion PackagesLocation string -- cgit v1.3