public static int GetDistance(Offset a, Offset b) { Hexagonal ac = a.GetHex(); Hexagonal bc = b.GetHex(); return(Hexagonal.GetDistance(ac, bc)); }
public int GetDistance(Offset other) { Hexagonal a = GetHex(); Hexagonal b = Offset.GetHex(other); return(Hexagonal.GetDistance(a, b)); }
static int GetHexHeuristic(Offset pos1, Offset pos2) { Hexagonal a = pos1.GetHex(); Hexagonal b = pos2.GetHex(); return(Math.Abs(a.x - b.x) + Math.Abs(a.y - b.y) + Math.Abs(a.z - b.z)); }
public override object Run(RunModes runMode, object input, bool Logging) { int minIndex = (int)input + 1; while (true) { long tri = Triangle.Generate(minIndex); if (Pentagonal.IsPentagonal(tri) && Hexagonal.IsHexagonal(tri)) { return(tri); } minIndex++; } }
public static int GetRotation(Hexagonal from, Hexagonal to) { int x = to.x - from.x; int y = to.y - from.y; int z = to.z - from.z; for (int i = 0; i < 6; ++i) { if (rotations[i].x == x && rotations[i].y == y && rotations[i].z == z) { return(i); } } return(0); }
public static int GetDistance(Hexagonal a, Hexagonal b) { return((Math.Abs(a.x - b.x) + Math.Abs(a.y - b.y) + Math.Abs(a.z - b.z)) / 2); }
public int GetDistance(Hexagonal other) { return((Math.Abs(other.x - x) + Math.Abs(other.y - y) + Math.Abs(other.z - z)) / 2); }
public static int GetRotation(Offset from, Offset to) { return(Hexagonal.GetRotation(from.GetHex(), to.GetHex())); }