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;
 }
コード例 #2
0
        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());
        }