-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathData.cs
197 lines (148 loc) · 7.48 KB
/
Data.cs
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
using System.Collections.Generic;
using PearlCalculatorLib.Result;
using PearlCalculatorLib.PearlCalculationLib.World;
using PearlCalculatorLib.PearlCalculationLib.Entity;
using PearlCalculatorLib.Settings;
namespace PearlCalculatorLib.General
{
public static class Data
{
/// <summary>
/// The Local Coordinate of the North West TNT
/// <para>Origin is set to the middle of the lava pool</para>
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static Space3D NorthWestTNT { get; set; } = new Space3D(-0.884999990463257 , 170.5 , -0.884999990463257);
/// <summary>
/// The Local Coordinate of the North East TNT
/// <para>Origin is set to the middle of the lava pool</para>
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static Space3D NorthEastTNT { get; set; } = new Space3D(+0.884999990463257 , 170.5 , -0.884999990463257);
/// <summary>
/// The Local Coordinate of the South West TNT
/// <para>Origin is set to the middle of the lava pool</para>
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static Space3D SouthWestTNT { get; set; } = new Space3D(-0.884999990463257 , 170.5 , +0.884999990463257);
/// <summary>
/// The Local Coordinate of the South East TNT
/// <para>Origin is set to the middle of the lava pool</para>
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static Space3D SouthEastTNT { get; set; } = new Space3D(+0.884999990463257 , 170.5 , +0.884999990463257);
/// <summary>
/// The Gobal Coordinate of the Destination
/// <para>Note : Y coordinate can be ignored. It does not take part in any calculation</para>
/// <para>Required for <see cref="Calculation.CalculateTNTAmount(int, double)"/></para>
/// </summary>
public static Space3D Destination { get; set; } = new Space3D();
/// <summary>
/// The Gobal Coordinate(Only Y Axis is related to pearl) and motion of the Ender Pearl
/// <para>Note : X and Z should be the gobal coordinate of the lava pool center</para>
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static PearlEntity Pearl { get; set; } = new PearlEntity().WithPosition(0 , 170.34722638929412 , 0).WithMotion(0 , 0.2716278719434352 , 0);
/// <summary>
/// The Offset between Ender Pearl X and Z coordinate and lava pool center coordinate
/// <para>Required for All Calculation in <see cref="Calculation"/></para>
/// </summary>
public static Surface2D PearlOffset
{
get => _PearlOffset;
set
{
if(value.IsInside(SouthEastTNT.ToSurface2D() , NorthWestTNT.ToSurface2D()))
_PearlOffset = value;
}
}
private static Surface2D _PearlOffset = new Surface2D(0 , 0);
/// <summary>
/// The number of Blue TNT for accelerating the Ender Pearl
/// <para>Note : Not bound to any calculation. You can store Blue acceleration TNT here or ignore this </para>
/// </summary>
public static int BlueTNT { get; set; }
/// <summary>
/// The number of Red TNT for accelerating the Ender Pearl
/// <para>Note : Not bound to any calculation. You can store Red acceleration TNT here or ignore this </para>
/// </summary>
public static int RedTNT { get; set; }
/// <summary>
/// The weight value for sorting the result
/// <para>Note : Value Must be a Natural Number which is not larger than 100</para>
/// <para>Required for <see cref="TNTCalculationResultSortComparerByWeighted"/></para>
/// </summary>
public static int TNTWeight { get; set; }
/// <summary>
/// The Max number of TNT from each side
/// <para>Required for <see cref="Calculation.CalculateTNTAmount(int, double)"/></para>
/// </summary>
public static int MaxTNT { get; set; }
public static int MaxCalculateTNT { get; internal set; }
public static double MaxCalculateDistance { get; internal set; }
/// <summary>
/// The acceleration direction of the Ender Pearl
/// <para>Note : Not bound to any calculation. You can store your acceleration direction here or ignore this </para>
/// <para>Note : Only Allow For North, South, East, West</para>
/// </summary>
public static Direction Direction { get; set; } = Direction.North;
/// <summary>
/// The default position in the lava pool. Should be opposite to Blue
/// <para>Note : Only Allow For NorthWest, NorthEast, SouthWest, SouthEast</para>
/// <para>Required for all calculation in <see cref="Calculation"/></para>
/// </summary>
public static Direction DefaultRedDuper
{
get => _DefaultRedDuper;
set
{
if((value.IsNorth() || value.IsSouth()) && (value.IsEast() || value.IsWest()))
_DefaultRedDuper = value;
}
}
private static Direction _DefaultRedDuper = Direction.SouthEast;
/// <summary>
/// The default position in the lava pool. Should be opposite to Red
/// <para>Note : Only Allow For NorthWest, NorthEast, SouthWest, SouthEast</para>
/// <para>Required for all calculation in <see cref="Calculation"/></para>
/// </summary>
public static Direction DefaultBlueDuper
{
get => _DefaultBlueDuper;
set
{
if((value.IsNorth() || value.IsSouth()) && (value.IsEast() || value.IsWest()))
_DefaultBlueDuper = value;
}
}
private static Direction _DefaultBlueDuper = Direction.NorthWest;
/// <summary>
/// The Result of the <see cref="Calculation.CalculateTNTAmount(int, double)"/>
/// <para>Note : It is a Data Output</para>
/// </summary>
public static List<TNTCalculationResult> TNTResult { get; set; } = new List<TNTCalculationResult>();
/// <summary>
/// A list of TNT configuration.
/// </summary>
public static List<int> RedTNTConfiguration { get; set; } = new List<int>();
/// <summary>
/// A list if TNT configuration
/// </summary>
public static List<int> BlueTNTConfiguration { get; set; } = new List<int>();
/// <summary>
/// Reset the whole <see cref="Data"/> into default value
/// </summary>
public static void Reset()
{
NorthWestTNT = new Space3D(-0.884999990463257 , 170.5 , -0.884999990463257);
NorthEastTNT = new Space3D(+0.884999990463257 , 170.5 , -0.884999990463257);
SouthWestTNT = new Space3D(-0.884999990463257 , 170.5 , +0.884999990463257);
SouthEastTNT = new Space3D(+0.884999990463257 , 170.5 , +0.884999990463257);
Pearl.Position = new Space3D(0 , 170.34722638929412 , 0);
Pearl.Motion = new Space3D(0 , 0.2716278719434352 , 0);
DefaultRedDuper = Direction.SouthEast;
DefaultBlueDuper = Direction.NorthWest;
PearlOffset = new Surface2D();
}
}
}