summaryrefslogtreecommitdiff
path: root/AmplifyOcclusion/VersionInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'AmplifyOcclusion/VersionInfo.cs')
-rw-r--r--AmplifyOcclusion/VersionInfo.cs61
1 files changed, 61 insertions, 0 deletions
diff --git a/AmplifyOcclusion/VersionInfo.cs b/AmplifyOcclusion/VersionInfo.cs
new file mode 100644
index 0000000..c460b70
--- /dev/null
+++ b/AmplifyOcclusion/VersionInfo.cs
@@ -0,0 +1,61 @@
+using System;
+using UnityEngine;
+
+namespace AmplifyOcclusion;
+
+[Serializable]
+public class VersionInfo
+{
+ public const byte Major = 1;
+
+ public const byte Minor = 2;
+
+ public const byte Release = 3;
+
+ private static string StageSuffix = "_dev001";
+
+ [SerializeField]
+ private int m_major;
+
+ [SerializeField]
+ private int m_minor;
+
+ [SerializeField]
+ private int m_release;
+
+ public int Number => m_major * 100 + m_minor * 10 + m_release;
+
+ private VersionInfo()
+ {
+ m_major = 1;
+ m_minor = 2;
+ m_release = 3;
+ }
+
+ private VersionInfo(byte major, byte minor, byte release)
+ {
+ m_major = major;
+ m_minor = minor;
+ m_release = release;
+ }
+
+ public static string StaticToString()
+ {
+ return $"{(byte)1}.{(byte)2}.{(byte)3}" + StageSuffix;
+ }
+
+ public override string ToString()
+ {
+ return $"{m_major}.{m_minor}.{m_release}" + StageSuffix;
+ }
+
+ public static VersionInfo Current()
+ {
+ return new VersionInfo(1, 2, 3);
+ }
+
+ public static bool Matches(VersionInfo version)
+ {
+ return version.m_major == 1 && version.m_minor == 2 && 3 == version.m_release;
+ }
+}