summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/I2.Loc/LanguageData.cs
blob: 566d28af1c18fa71f33bb4990c166832ede70a5c (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
62
63
64
65
66
67
using System;

namespace I2.Loc;

[Serializable]
public class LanguageData
{
	public string Name;

	public string Code;

	public byte Flags;

	[NonSerialized]
	public bool Compressed;

	public bool IsEnabled()
	{
		return (Flags & 1) == 0;
	}

	public void SetEnabled(bool bEnabled)
	{
		if (bEnabled)
		{
			Flags = (byte)(Flags & 0xFFFFFFFEu);
		}
		else
		{
			Flags |= 1;
		}
	}

	public bool IsLoaded()
	{
		return (Flags & 4) == 0;
	}

	public bool CanBeUnloaded()
	{
		return (Flags & 2) == 0;
	}

	public void SetLoaded(bool loaded)
	{
		if (loaded)
		{
			Flags = (byte)(Flags & 0xFFFFFFFBu);
		}
		else
		{
			Flags |= 4;
		}
	}

	public void SetCanBeUnLoaded(bool allowUnloading)
	{
		if (allowUnloading)
		{
			Flags = (byte)(Flags & 0xFFFFFFFDu);
		}
		else
		{
			Flags |= 2;
		}
	}
}