// 如果這個點剛好是目的地,回傳true. private bool DeStatusForVector(Queue <BFS_Status> routeTree, BFS_Status status, Vector2D vector) { var point = status.point.VectorOf(vector); if (point.OutOfRange(width, width)) { return(false); } if (IsPassable(point)) { routeTree.Enqueue(new BFS_Status(point, vector, status)); SetNotPassAble(point); } if (IsDest(point)) { return(true); } return(false); }
public BFS_Status(BFS_Point point, Vector2D vector, BFS_Status lastStatus) { this.point = point; this.vector = vector; this.lastStatus = lastStatus; }