-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSquareProperties.cs
More file actions
61 lines (53 loc) · 2.19 KB
/
SquareProperties.cs
File metadata and controls
61 lines (53 loc) · 2.19 KB
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 System.Diagnostics;
namespace ExileWorldGenerator
{
internal class SquareProperties
{
internal SquareProperties(WorldSquare worldSquare, GeneratedBackground generatedBackground, BackgroundOverride? backgroundOverride, GetPaletteResult getPaletteResult)
{
this.WorldSquare = worldSquare;
this.GeneratedBackground = generatedBackground ?? throw new ArgumentNullException(nameof(generatedBackground));
this.BackgroundOverride = backgroundOverride;
this.GetPaletteResult = getPaletteResult ?? throw new ArgumentNullException(nameof(getPaletteResult));
}
public readonly WorldSquare WorldSquare;
public readonly GeneratedBackground GeneratedBackground;
public readonly BackgroundOverride? BackgroundOverride;
public readonly GetPaletteResult GetPaletteResult;
public byte FinalBackground
{
get
{
byte result;
if (this.GetPaletteResult.Background.HasValue)
result = this.GetPaletteResult.Background.Value;
else if (this.BackgroundOverride != null)
result = this.BackgroundOverride.Background;
else
result = this.GeneratedBackground.Background;
Debug.Assert(result <= 0x3f);
return result;
}
}
public byte FinalOrientation
{
get
{
byte result;
if (this.GetPaletteResult.Orientation.HasValue)
result = this.GetPaletteResult.Orientation.Value;
else if (this.BackgroundOverride != null)
result = this.BackgroundOverride.Orientation;
else
result = this.GeneratedBackground.Orientation;
Debug.Assert((result & 0x3f) == 0);
return result;
}
}
public string? BackgroundHandlerType;
public string? BackgroundDescription;
public TimeSpan? NextAnimationFrame;
public int AnimationFrame;
}
}