⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pathfinder.java

📁 Developing Games in Java 源代码
💻 JAVA
字号:
package com.brackeen.javagamebook.path;

import java.util.Iterator;
import com.brackeen.javagamebook.game.GameObject;
import com.brackeen.javagamebook.math3D.Vector3D;

/**
    The PathFinder interface is a function that finds a path
    (represented by a List of Vector3Ds) from one location to
    another, or from one GameObject to another. Note that the
    find() method can ignore the requested goal, and instead
    give an arbitrary path, like patrolling in a set path or
    running away from the goal.
*/
public interface PathFinder {

    /**
        Finds a path from GameObject A to GameObject B. The path
        is an Iterator of Vector3Ds, not including the start
        location (GameObject A) but including the goal location
        (GameObject B). The Vector3D objects may be used in
        other objects and should not be modified.
        Returns null if no path found.
    */
    public Iterator find(GameObject a, GameObject b);


    /**
        Finds a path from the start location to the goal
        location. The path is an Iterator of Vector3Ds, not
        including the start location, but including the goal
        location. The Vector3D objects may be used in other
        objects and should not be modified. Returns null if no
        path found.
    */
    public Iterator find(Vector3D start, Vector3D goal);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -