updating ignore
This commit is contained in:
@@ -44,39 +44,4 @@ public class LocationResponse
|
||||
IsVisible = true
|
||||
};
|
||||
|
||||
public static LocationResponse FromCoordinate(int q, int r) => new()
|
||||
{
|
||||
Q = q,
|
||||
R = r,
|
||||
Terrain = LocationTerrain.FromCoordinate(q, r),
|
||||
Kind = "Open",
|
||||
Level = 1,
|
||||
UpdatedAtUtc = DateTime.UtcNow,
|
||||
IsVisible = true
|
||||
};
|
||||
}
|
||||
|
||||
public static class LocationTerrain
|
||||
{
|
||||
public static string FromCoordinate(int q, int r)
|
||||
{
|
||||
var height = Math.Max(Math.Max(Math.Abs(q), Math.Abs(r)), Math.Abs(-q - r));
|
||||
if (height <= 1)
|
||||
{
|
||||
return "Command";
|
||||
}
|
||||
if ((q * 19 + r * 7) % 5 == 0)
|
||||
{
|
||||
return "Highland";
|
||||
}
|
||||
if ((q + r) % 4 == 0)
|
||||
{
|
||||
return "Forest";
|
||||
}
|
||||
if ((q * 3 - r) % 6 == 0)
|
||||
{
|
||||
return "Ore";
|
||||
}
|
||||
return "Field";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user