• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ScoutingMission类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中net.sf.freecol.server.ai.mission.ScoutingMission的典型用法代码示例。如果您正苦于以下问题:Java ScoutingMission类的具体用法?Java ScoutingMission怎么用?Java ScoutingMission使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ScoutingMission类属于net.sf.freecol.server.ai.mission包,在下文中一共展示了ScoutingMission类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: trySomeUsefulMission

点赞 2

import net.sf.freecol.server.ai.mission.ScoutingMission; //导入依赖的package包/类
public boolean trySomeUsefulMission(Colony colony, LogBuilder lb) {
    Mission m = getMission();
    if (m instanceof BuildColonyMission
        || m instanceof DefendSettlementMission
        || m instanceof MissionaryMission
        || m instanceof PioneeringMission
        || m instanceof ScoutingMission
        || m instanceof UnitSeekAndDestroyMission)
        return true;
    Location oldTarget = (m == null) ? null : m.getTarget();
    AIPlayer aiPlayer = getAIOwner();

    if(aiPlayer instanceof EuropeanAIPlayer) {
        EuropeanAIPlayer euaiPlayer = (EuropeanAIPlayer)getAIOwner();

        if (unit.hasAbility(Ability.SPEAK_WITH_CHIEF)
            && (m = euaiPlayer.getScoutingMission(this)) != null) {
            lb.add(", ", m);
            euaiPlayer.updateTransport(this, oldTarget, lb);
            return true;
        } else if (unit.isDefensiveUnit()
            && (m = euaiPlayer.getDefendSettlementMission(this, colony)) != null) {
            lb.add(", ", m);
            euaiPlayer.updateTransport(this, oldTarget, lb);
            return true;
        } else if (unit.hasAbility(Ability.ESTABLISH_MISSION)
            && (m = euaiPlayer.getMissionaryMission(this)) != null) {
            lb.add(", ", m);
            euaiPlayer.updateTransport(this, oldTarget, lb);
            return true;
        }
    }
    return false;
}
 

开发者ID:FreeCol,
项目名称:freecol,
代码行数:35,
代码来源:AIUnit.java

示例2: getScoutingMission

点赞 2

import net.sf.freecol.server.ai.mission.ScoutingMission; //导入依赖的package包/类
/**
 * Gets a new ScoutingMission for a unit.
 *
 * @param aiUnit The {@code AIUnit} to check.
 * @return A new mission, or null if impossible.
 */
public Mission getScoutingMission(AIUnit aiUnit) {
    if (ScoutingMission.prepare(aiUnit) != null) return null;
    Location loc = ScoutingMission.findTarget(aiUnit, scoutingRange, true);
    if (loc == null) {
        Unit unit = aiUnit.getUnit();
        if (unit.isInEurope() || unit.getSettlement() != null) {
            aiUnit.equipForRole(getSpecification().getDefaultRole());
        }
        return null;
    }            
    return new ScoutingMission(getAIMain(), aiUnit, loc);
}
 

开发者ID:FreeCol,
项目名称:freecol,
代码行数:19,
代码来源:EuropeanAIPlayer.java

示例3: getScoutingMission

点赞 1

import net.sf.freecol.server.ai.mission.ScoutingMission; //导入依赖的package包/类
/**
 * Gets a new ScoutingMission for a unit.
 *
 * Public for AIColony.
 *
 * @param aiUnit The <code>AIUnit</code> to check.
 * @return A new mission, or null if impossible.
 */
public Mission getScoutingMission(AIUnit aiUnit) {
    String reason = ScoutingMission.prepare(aiUnit);
    if (reason != null) return null;
    Location loc = ScoutingMission.findTarget(aiUnit, scoutingRange, true);
    return (loc == null) ? null
        : new ScoutingMission(getAIMain(), aiUnit, loc);
}
 

开发者ID:vishal-mittal,
项目名称:SOEN6471-FreeCol,
代码行数:16,
代码来源:EuropeanAIPlayer.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)