mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 13:03:06 +00:00
f89d9ca323
precompute Index & make readonly when initializing as we use Index at least once when initializing the treesarea
19 lines
No EOL
437 B
C#
19 lines
No EOL
437 B
C#
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Coordinate / Index Relationship for a Generation 2 Headbutt Tree
|
|
/// </summary>
|
|
internal sealed class TreeCoordinates
|
|
{
|
|
public readonly int X;
|
|
public readonly int Y;
|
|
public readonly int Index;
|
|
|
|
public TreeCoordinates(int x, int y)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
Index = ((X * Y) + X + Y) / 5 % 10;
|
|
}
|
|
}
|
|
} |