public bool CanJump(Position p1, Position p2)
{
if (TileType != TileType.OCTILE && this.TileType != TileType.OCTILE_UNICOST)
return true;
if (Helpers.AreAligned(p1, p2))
return true;
// The following piece of code existed in the original implementation.
// It basically checks that you do not forcefully cross a blocked diagonal.
// Honestly, this is weird, bad designed and supposes that each position is adjacent to each other.
var nodeInfo12 = Graph.GetNode(GetNodeIdFromPos(p2.X, p1.Y)).Info;
var nodeInfo21 = Graph.GetNode(GetNodeIdFromPos(p1.X, p2.Y)).Info;
return !(nodeInfo12.IsObstacle && nodeInfo21.IsObstacle);
}