//public static IEnumerable FindPath(IQPathWorld world, IQPathUnit unit, IQPathTile startTile, IQPathTile endTile)


        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile
        {
            Util.WriteDebugLog(string.Format("QPath::FindPath() run"), GameManager.LogLevel_Error, GameManager.instance.debug, GameManager.instance.LogLevel);

            if (world == null || unit == null | startTile == null || endTile == null)
            {
                Util.WriteDebugLog(string.Format("Null value passed to QPath::FindPath()"), GameManager.LogLevel_Error, GameManager.instance.debug, GameManager.instance.LogLevel);
                Debug.LogError("QPath::FindPath() ERROR");
                return(null);
            }

            // Call on our actual path solver
            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();

            //TODO fix this
            return(resolver.GetList());
        }
Esempio n. 2
0
        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile
        {
            DebugLogger.Trace("QPath::FindPath");
            if (world == null || unit == null || startTile == null || endTile == null)
            {
                DebugLogger.Log(LogLevel.Error, "null values passed to FindPath", "QPath");
                return(null);
            }

            // Call on our actual path solver


            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();

            DebugLogger.Trace("QPath::FindPath");
            return(resolver.GetList());
        }
 public QPath_AStar(
     IQPathWorld world,
     IQPathUnit unit,
     T starttile,
     T endtile,
     CostEstimateDelegate CostEstimateFunc)
 {
     this.world            = world;
     this.unit             = unit;
     this.starttile        = starttile;
     this.endtile          = endtile;
     this.CostEstimateFunc = CostEstimateFunc;
 }
Esempio n. 4
0
        public QPath_AStar(IQPathWorld world,
                           IQPathUnit unit,
                           T startTile,
                           T endTile,
                           CostEstimateDelegate costEstimateFunc)
        {
            this.world     = world;
            this.unit      = unit;
            this.startTile = startTile;
            this.endTile   = endTile;
            this.costEstimateDelegateFunc = costEstimateFunc;

            // Do we need to explicitly create a graph?
        }
Esempio n. 5
0
 public QPath_AStar(
     IQPathWorld theWorld,
     IQPathUnit theUnit,
     T startTile,
     T endTile,
     CostEstimateDelegate costEstimateFunc
     )
 {
     // Do Setup
     this.theWorld         = theWorld;
     this.theUnit          = theUnit;
     this.startTile        = startTile;
     this.endTile          = endTile;
     this.costEstimateFunc = costEstimateFunc;
 }
Esempio n. 6
0
 public QPath_AStar(
     IQPathWorld world,
     IQPathUnit unit,
     T startTile,
     T endTile,
     CostEstimateDelegate costEstimateFunc
     )
 {
     // Setup
     this.world            = world;
     this.unit             = unit;
     this.startTile        = startTile;
     this.endTile          = endTile;
     this.costEstimateFunc = costEstimateFunc;
 }
Esempio n. 7
0
        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile
        {
            if (world == null || unit == null || startTile == null || endTile == null)
            {
                return(null);
            }

            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();
            return(resolver.GetList());
        }
Esempio n. 8
0
        public static T[] FindPath <T>(
            IQPathWorld theWorld,
            IQPathUnit theUnit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile
        {
            // Debug.Log("QPath started!");
            if (theWorld == null || theUnit == null || startTile == null || endTile == null)
            {
                Debug.LogError("Null in pathfinding QPath:IQPathTile:FindPath");
                return(null);
            }

            QPath_AStar <T> resolver = new QPath_AStar <T>(theWorld, theUnit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();
            return(resolver.GetList());
        }
Esempio n. 9
0
        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile
        {
            //Debug.Log("QPath::FindPath");
            if (world == null || unit == null || startTile == null || endTile == null)
            {
                //Debug.LogError("Null values passed to QPath::FindPath");
                return(null);
            }

            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();

            return(resolver.GetList());
        }
Esempio n. 10
0
        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T starttile,
            T endtile,
            CostEstimateDelegate CostEstimateFunc

            ) where T : IQPathTile
        {
            //Debug.Log("Running Status");

            if (world == null || unit == null || starttile == null || endtile == null)
            {
                Debug.LogError("null values passes");
            }

            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, starttile, endtile, CostEstimateFunc);

            resolver.DoWork();

            return(resolver.GetList());
        }
Esempio n. 11
0
        public static T[] FindPath <T>(
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile
            ) where T : IQPathTile
        {
            //Debug.Log("QPath::FindPath");
            if (world == null || unit == null || startTile == null || endTile == null)
            {
                //Debug.LogError("null values passed to QPath::FindPath");
                return(null);
            }

            // Call on our actual path solver


            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile);

            resolver.DoWork();
            return(resolver.GetList());
        }
Esempio n. 12
0
        public static T[] FindPath <T>( //<T> define FindPath as generic - specify object type inside angle braces (that implements IQPathTile)
            IQPathWorld world,
            IQPathUnit unit,
            T startTile,
            T endTile,
            CostEstimateDelegate costEstimateFunc
            ) where T : IQPathTile //requires (guarentees) that whatever class T is, it implements IQPathTile
        {
            //error checking
            Debug.Log("QPath::FindPath");
            if (world == null || unit == null || startTile == null || endTile == null)
            {
                Debug.LogError("null values passed to QPath::FindPath");
                return(null);
            }

            // Call on the path solver (A* in this case)

            QPath_AStar <T> resolver = new QPath_AStar <T>(world, unit, startTile, endTile, costEstimateFunc);

            resolver.DoWork();

            return(resolver.GetList());
        }
Esempio n. 13
0
 public QPath_TileGraph(IQPathWorld world)
 {
 }