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


Java Tile.isExploredBy方法代码示例

本文整理汇总了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;
        }
    };
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:32,代码来源:GoalDeciders.java

示例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";
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:14,代码来源:ScoutingMission.java

示例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);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:13,代码来源:ServerPlayer.java


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