Esempio n. 1
0
    private static bool WithinClusterRange(ref List <Unit> cluster, HexCell h, int range)
    {
        foreach (Unit u in cluster)
        {
            if (HexCell.CubeDistance(h, u.CurrentHex) <= range)
            {
                return(true);
            }
        }

        return(false);
    }
Esempio n. 2
0
 // the cost heuristic, in this case, euclidian distance
 static public int Heuristic(HexCell a, HexCell b)
 {
     return(HexCell.CubeDistance(a, b)); //HexCell.LineDistance(a.transform.position, b.transform.position);
 }