当前位置: 首页>>代码示例>>Java>>正文


Java Mover类代码示例

本文整理汇总了Java中org.newdawn.slick.util.pathfinding.Mover的典型用法代码示例。如果您正苦于以下问题:Java Mover类的具体用法?Java Mover怎么用?Java Mover使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Mover类属于org.newdawn.slick.util.pathfinding包,在下文中一共展示了Mover类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int)
 */
public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty) {		
	float dx = tx - x;
	float dy = ty - y;
	
	return ((dx*dx)+(dy*dy));
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:10,代码来源:ClosestSquaredHeuristic.java

示例2: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int)
 */
public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty) {		
	float dx = tx - x;
	float dy = ty - y;
	
	float result = (float) (Math.sqrt((dx*dx)+(dy*dy)));
	
	return result;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:12,代码来源:ClosestHeuristic.java

示例3: blocked

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see TileBasedMap#blocked(Mover, int, int)
 */
public boolean blocked(Mover mover, int x, int y) {
    // if there's a unit at the location, then it's blocked

    if (getUnit(x,y) != 0) {
        return true;
    }

    int unit = ((RoverMover) mover).getType();

    // Either it's blocked or its not, simpler
    return terrain[x][y] == BLOCKED;
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:16,代码来源:LabMap.java

示例4: blocked

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.util.pathfinding.TileBasedMap#blocked(org.newdawn.slick.util.pathfinding.Mover, int, int)
 */
public boolean blocked(Mover mover, int x, int y) {
    // if theres a unit at the location, then it's blocked

    if (getUnit(x,y) != 0) {
        return true;
    }

    int unit = ((RoverMover) mover).getType();

    // Either it's blocked or its not, simpler
    return terrain[x][y] == BLOCKED;
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:16,代码来源:PresentationMap.java

示例5: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int)
 */
public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx, int ty) {
    float dx = tx - x;
    float dy = ty - y;

    float result = (float) (Math.sqrt((dx*dx)+(dy*dy)));

    return result;
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:12,代码来源:ClosestHeuristic.java

示例6: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
@Override
   public float getCost(TileBasedMap ctx, Mover mover, int x, int y,
    int goalX, int goalY) {
return Math.max(Math.abs(x - goalX), Math.abs(y - goalY));
/*
      float diagonal = Math.min(Math.abs(x - goalX), Math.abs(y - goalY));
      float straight = (Math.abs(x - goalX) + Math.abs(y - goalY));
      float h = (DIAGONAL_COST * diagonal) + (ADJACENT_COST * (straight - (2f * diagonal)));

      return h;*/
   }
 
开发者ID:Cr0s,项目名称:JavaRA,代码行数:12,代码来源:VehiclePathfinder.java

示例7: getMover

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
public Mover getMover() {
	return null;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:4,代码来源:NavMeshTest.java

示例8: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see AStarHeuristic#getCost(TileBasedMap, Mover, int, int, int, int)
 */
public float getCost(TileBasedMap map, Mover mover, int x, int y, int tx,
		int ty) {
	return minimumCost * (Math.abs(x-tx) + Math.abs(y-ty));
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:8,代码来源:ManhattanHeuristic.java

示例9: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see TileBasedMap#getCost(Mover, int, int, int, int)
 */
public float getCost(Mover mover, int sx, int sy, int tx, int ty) {
    return 1;
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:7,代码来源:LabMap.java

示例10: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.util.pathfinding.TileBasedMap#getCost(Mover, int, int, int, int)
 */
public float getCost(Mover mover, int sx, int sy, int tx, int ty) {
    return 1;
}
 
开发者ID:sciencectn,项目名称:SmartRover,代码行数:7,代码来源:PresentationMap.java

示例11: getCost

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
@Override
   public float getCost(TileBasedMap ctx, Mover mover, int x, int y,
    int goalX, int goalY) {
return Math.max(Math.abs(x - goalX), Math.abs(y - goalY));
   }
 
开发者ID:Cr0s,项目名称:JavaRA,代码行数:6,代码来源:InfantryPathfinder.java

示例12: getMover

import org.newdawn.slick.util.pathfinding.Mover; //导入依赖的package包/类
/**
 * Path finding context implementation
 * 
 * @return The current mover
 */
public Mover getMover() {
	return null;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:9,代码来源:NavMeshBuilder.java


注:本文中的org.newdawn.slick.util.pathfinding.Mover类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。