public void DUMMY_PATHING_FUNCTION() { /*QPath.CostEstimateDelegate ced = (IQPathTileScript a, IQPathTileScript b) => ( * return Hex.Distance(a, b); * );*/ HexScript[] pathHexes = QPathScript.FindPath( Hex.HexMap, this, Hex, //Hex.HexMap.GetHexAt(Hex.C + 1, Hex.R + 3), Hex.HexMap.GetHexAt(Hex.C + MouseManagerScript.instance.selectedHexColumnPositioningDifference, Hex.R + MouseManagerScript.instance.selectedHexRowPositioningDifference), HexScript.CostEstimate ); Debug.Log("Got pathfinding path of length: " + pathHexes.Length); MouseManagerScript.instance.PathCount(pathHexes.Length); SetHexPath(pathHexes); }
public void PotentialEnergyUsage() { HexScript[] pathHexes = QPathScript.FindPath( Hex.HexMap, this, Hex, //Hex.HexMap.GetHexAt(Hex.C + 1, Hex.R + 3), Hex.HexMap.GetHexAt(Hex.C + MouseManagerScript.instance.selectedHexColumnPositioningDifference, Hex.R + MouseManagerScript.instance.selectedHexRowPositioningDifference), HexScript.CostEstimate ); string test = "Got pathfinding path of movmentValue: "; int potentialUsageOfEnergy = 0; int count = 0; foreach (var hex in pathHexes) { if (count == 0) { count++; } else if (pathHexes.Length < pathHexes.Length - 1) { test += hex.movementCost + ", "; potentialUsageOfEnergy += hex.movementCost; } else { test += hex.movementCost + "."; potentialUsageOfEnergy += hex.movementCost; } Debug.LogError(test + " Total Movement Cost: " + potentialUsageOfEnergy); } MouseManagerScript.instance.PathCount(pathHexes.Length); CanvasManagerScript._instance.DisplayEnergyUsage(potentialUsageOfEnergy, MovementRemaining); }