public float AggregateCostToEnter(float costSoFar, IQPathTileScript sourceTile, IQPathUnitScript theUnit) { // TODO: We are ignoring source tile right now, this will have to change when // we have rivers. if (StateManagerScript.instance.aiTurn == true) { return(((AIUnitScript)theUnit).AggregateTurnsToEnterHex(this, costSoFar)); } else { return(((UnitScript)theUnit).AggregateTurnsToEnterHex(this, costSoFar)); } }
public QPath_AStarScript( IQPathWorldScript World, IQPathUnitScript Unit, T StartTile, T EndTile, CostEstimateDelegate CostEstimateFunction ) { this.world = World; this.unit = Unit; this.startTile = StartTile; this.endTile = EndTile; this.costEstimateFunction = CostEstimateFunction; }
public static T[] FindPath <T>( IQPathWorldScript world, IQPathUnitScript unit, T startTile, T endTile, CostEstimateDelegate costEstimateFunction ) where T : IQPathTileScript { if (world == null || unit == null || startTile == null || endTile == null) { Debug.LogError("Null Value passed to QPath::FindPath"); return(null); } // Call on our actual path solver QPath_AStarScript <T> resolver = new QPath_AStarScript <T>(world, unit, startTile, endTile, costEstimateFunction); resolver.DoWork(); return(resolver.GetList()); }
public float AggregateCostToEnter(float costSoFar, IQPathTileScript sourceTile, IQPathUnitScript theUnit) { // TODO: We are ignoring source tile right now, this will have to change when // we have rivers. return(((UnitScript)theUnit).AggregateTurnsToEnterHex(this, costSoFar)); }