コード例 #1
0
		public void Search(AStarFindHeuristic heuristic, int startx, int starty,
				int endx, int endy, bool flying, bool flag,
				AStarFinderListener callback) {
			AStarFinder pathfinderTask = new AStarFinder(heuristic, field, startx,
					starty, endx, endy, flying, flag, callback);
			AStarFinder existing = pathQueue.Contains(pathfinderTask);
			if (existing != null) {
				existing.Update(pathfinderTask);
			} else {
				pathQueue.Add(pathfinderTask);
			}
			pathfinderThread.Interrupt();
		}
コード例 #2
0
ファイル: AStarFinder.cs プロジェクト: zx8326123/LGame
 public AStarFinder(AStarFindHeuristic heuristic, Field2D field_0, int startX_1,
                    int startY_2, int endX_3, int endY_4, bool flying_5, bool flag_6,
                    AStarFinderListener callback)
 {
     this.field             = field_0;
     this.startX            = startX_1;
     this.startY            = startY_2;
     this.endX              = endX_3;
     this.endY              = endY_4;
     this.flying            = flying_5;
     this.flag              = flag_6;
     this.pathFoundListener = callback;
     this.findHeuristic     = heuristic;
 }
コード例 #3
0
ファイル: AStarFinderPool.cs プロジェクト: vb0067/LGame
        public void Search(AStarFindHeuristic heuristic, int startx, int starty,
                           int endx, int endy, bool flying, bool flag,
                           AStarFinderListener callback)
        {
            AStarFinder pathfinderTask = new AStarFinder(heuristic, field, startx,
                                                         starty, endx, endy, flying, flag, callback);
            AStarFinder existing = pathQueue.Contains(pathfinderTask);

            if (existing != null)
            {
                existing.Update(pathfinderTask);
            }
            else
            {
                pathQueue.Add(pathfinderTask);
            }
            pathfinderThread.Interrupt();
        }
コード例 #4
0
ファイル: AStarFinder.cs プロジェクト: wethinkall/LGame
 public AStarFinder(AStarFindHeuristic heuristic, Field2D field_0, int startX_1,
         int startY_2, int endX_3, int endY_4, bool flying_5, bool flag_6,
         AStarFinderListener callback)
 {
     this.field = field_0;
     this.startX = startX_1;
     this.startY = startY_2;
     this.endX = endX_3;
     this.endY = endY_4;
     this.flying = flying_5;
     this.flag = flag_6;
     this.pathFoundListener = callback;
     this.findHeuristic = heuristic;
 }
コード例 #5
0
		public void Search(AStarFindHeuristic heuristic, int startx, int starty,
				int endx, int endy, bool flying, AStarFinderListener callback) {
			Search(heuristic, startx, starty, endx, endy, flying, false, callback);
		}
コード例 #6
0
ファイル: AStarFinderPool.cs プロジェクト: vb0067/LGame
 public void Search(AStarFindHeuristic heuristic, int startx, int starty,
                    int endx, int endy, bool flying, AStarFinderListener callback)
 {
     Search(heuristic, startx, starty, endx, endy, flying, false, callback);
 }