summaryrefslogtreecommitdiff
path: root/AmplifyOcclusion/VersionInfo.cs
blob: c460b70582ab8a453a384e4b734172c02bf0a4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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;
	}
}