本文整理汇总了Java中net.sf.freecol.common.model.Tile.isExploredBy方法的典型用法代码示例。如果您正苦于以下问题:Java Tile.isExploredBy方法的具体用法?Java Tile.isExploredBy怎么用?Java Tile.isExploredBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.freecol.common.model.Tile
的用法示例。
在下文中一共展示了Tile.isExploredBy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHighSeasGoalDecider
import net.sf.freecol.common.model.Tile; //导入方法依赖的package包/类
/**
* Gets a GoalDecider to find the closest high seas tile to a target.
* Used when arriving on the map from Europe.
*
* @return The high seas goal decider.
*/
public static GoalDecider getHighSeasGoalDecider() {
return new GoalDecider() {
private PathNode best = null;
@Override
public PathNode getGoal() { return best; }
@Override
public boolean hasSubGoals() { return false; }
@Override
public boolean check(Unit u, PathNode path) {
Tile tile = path.getTile();
if (tile != null
&& tile.isExploredBy(u.getOwner())
&& tile.isDirectlyHighSeasConnected()
&& (tile.getFirstUnit() == null
|| u.getOwner().owns(tile.getFirstUnit()))) {
if (best == null || path.getCost() < best.getCost()) {
best = path;
return true;
}
}
return false;
}
};
}
示例2: invalidTileReason
import net.sf.freecol.common.model.Tile; //导入方法依赖的package包/类
/**
* Is this a valid scouting target because it is a suitable tile.
*
* @param aiUnit The {@code AIUnit} to test.
* @param tile The {@code Tile} to test.
* @return A reason why the mission would be invalid, or null if none found.
*/
private static String invalidTileReason(AIUnit aiUnit, Tile tile) {
return (tile == null) ? "tile-null"
: (tile.hasLostCityRumour()) ? null
: (!tile.isExploredBy(aiUnit.getUnit().getOwner())) ? null
: "explored-tile-lacks-rumour";
}
示例3: hasExplored
import net.sf.freecol.common.model.Tile; //导入方法依赖的package包/类
/**
* Checks if this {@code Player} has explored the given
* {@code Tile}.
*
* @param tile The {@code Tile}.
* @return <i>true</i> if the {@code Tile} has been explored and
* <i>false</i> otherwise.
*/
@Override
public boolean hasExplored(Tile tile) {
return tile.isExploredBy(this);
}