本文整理汇总了Java中org.andengine.util.algorithm.path.IPathFinderMap类的典型用法代码示例。如果您正苦于以下问题:Java IPathFinderMap类的具体用法?Java IPathFinderMap怎么用?Java IPathFinderMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPathFinderMap类属于org.andengine.util.algorithm.path包,在下文中一共展示了IPathFinderMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY) {
final float dX = pToX - pFromX;
final float dY = pToY - pFromY;
return (float) Math.sqrt(dX * dX + dY * dY);
}
示例2: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY) {
final float dX = pToX - pFromX;
final float dY = pToY - pFromY;
return FloatMath.sqrt(dX * dX + dY * dY);
}
示例3: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY) {
return Math.abs(pFromX - pToX) + Math.abs(pFromY - pToY);
}
示例4: findPath
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public Path findPath(final IPathFinderMap<T> pPathFinderMap, final int pXMin, final int pYMin, final int pXMax, final int pYMax, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY, final boolean pAllowDiagonal, final IAStarHeuristic<T> pAStarHeuristic, final ICostFunction<T> pCostFunction) {
return this.findPath(pPathFinderMap, pXMin, pYMin, pXMax, pYMax, pEntity, pFromX, pFromY, pToX, pToY, pAllowDiagonal, pAStarHeuristic, pCostFunction, Float.MAX_VALUE);
}
示例5: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY) {
return 0;
}
示例6: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
@Override
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY) {
return Math.abs(pFromX - pToX) + Math.abs(pToX - pToY);
}
示例7: getExpectedRestCost
import org.andengine.util.algorithm.path.IPathFinderMap; //导入依赖的package包/类
public float getExpectedRestCost(final IPathFinderMap<T> pPathFinderMap, final T pEntity, final int pFromX, final int pFromY, final int pToX, final int pToY);