public class MixedFleetAI extends AbstractAI implements IFleetAI
| Modifier and Type | Class and Description |
|---|---|
protected static class |
MixedFleetAI.State |
| Modifier and Type | Field and Description |
|---|---|
protected float |
arrivalTime |
protected boolean |
canLaunch |
protected MixedFleetAI.State |
currentState |
protected DefConLocation |
currentTargetLocation |
protected List<Integer> |
enemyCityIds |
protected Fleet |
fleet |
protected float |
lastTargetSelect |
protected cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEventListener<DefConChanged> |
level3DefconListener |
protected DefConLocation |
optimizedTargetLocation |
protected DefConLocation |
originalLocation |
protected static double |
TARGET_SELECTION_LIMIT |
protected Fleet |
targetFleet |
protected DefConLocation |
targetLocation |
logic, unitId, worldObjectId| Constructor and Description |
|---|
MixedFleetAI(DefConLocation target,
Fleet fleet,
ExampleBotLogicController logic) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> boolean |
arrayContains(T[] array,
T element) |
protected <T> int |
arrayIndex(T[] array,
T element) |
protected String |
arrayToString(int[] array) |
protected void |
caculateBestMovementTarget() |
void |
dispose() |
protected int |
getClosestEnemyCityOwner(DefConLocation closestTo) |
Fleet |
getClosestEnemyFleet()
Returns the closest visible enemy fleet.
|
Fleet |
getClosestEnemyFleetWithUnit(UnitType type)
Returns the closest visible enemy fleet with given unit type.
|
Fleet |
getClosestEnemyFleetWithUnits(UnitType[] types)
Returns the closest visible enemy fleet with given unit type.
|
Fleet |
getFleet() |
int[] |
getFleetMembers() |
DefConLocation |
getLocation() |
ExampleBotLogicController |
getLogic() |
protected boolean |
hasSpareLaunchableNukes() |
protected boolean |
hasSpareNukes() |
protected boolean |
inNukeRange(DefConLocation unit,
DefConLocation target,
UnitType type) |
protected boolean |
inNukeRange(int unitId,
int cityId,
UnitType type) |
protected boolean |
inNukeState(int unitId) |
protected void |
launchNuke(int unitId,
int targetId) |
protected void |
moveFleet(DefConLocation target) |
protected boolean |
nukeCapable(int unitId) |
protected void |
optimizeOriginalLocation() |
protected void |
refreshClosestEnemyFleet() |
protected void |
runGotoAttackPosition() |
protected void |
runHunt() |
protected void |
runLaunchNukes() |
protected void |
setAttackTarget(int targetId) |
protected void |
setMoveToTarget() |
void |
setTargetLocation(DefConLocation target) |
protected boolean |
toNukeState(int unitId) |
void |
update() |
act, getId, receiveMessageclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetId, receiveMessageprotected final Fleet fleet
protected DefConLocation targetLocation
protected DefConLocation optimizedTargetLocation
protected DefConLocation currentTargetLocation
protected DefConLocation originalLocation
protected boolean canLaunch
protected float arrivalTime
protected MixedFleetAI.State currentState
protected final cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEventListener<DefConChanged> level3DefconListener
protected static final double TARGET_SELECTION_LIMIT
protected Fleet targetFleet
protected float lastTargetSelect
public MixedFleetAI(DefConLocation target, Fleet fleet, ExampleBotLogicController logic)
protected void optimizeOriginalLocation()
protected void setMoveToTarget()
protected void moveFleet(DefConLocation target)
protected void runGotoAttackPosition()
protected void runLaunchNukes()
protected void runHunt()
protected void setAttackTarget(int targetId)
protected void refreshClosestEnemyFleet()
protected void caculateBestMovementTarget()
protected int getClosestEnemyCityOwner(DefConLocation closestTo)
protected String arrayToString(int[] array)
protected boolean inNukeRange(int unitId,
int cityId,
UnitType type)
protected boolean inNukeRange(DefConLocation unit, DefConLocation target, UnitType type)
protected void launchNuke(int unitId,
int targetId)
protected boolean nukeCapable(int unitId)
protected boolean inNukeState(int unitId)
protected boolean toNukeState(int unitId)
protected boolean hasSpareNukes()
protected boolean hasSpareLaunchableNukes()
public final Fleet getFleet()
public final ExampleBotLogicController getLogic()
public void setTargetLocation(DefConLocation target)
setTargetLocation in interface IFleetAIpublic Fleet getClosestEnemyFleet()
public Fleet getClosestEnemyFleetWithUnit(UnitType type)
type - unitetype the enemy fleet has to containpublic Fleet getClosestEnemyFleetWithUnits(UnitType[] types)
type - unitetype the enemy fleet has to containpublic void dispose()
dispose in interface IUnitAIdispose in class AbstractAIprotected <T> boolean arrayContains(T[] array,
T element)
protected <T> int arrayIndex(T[] array,
T element)
public int[] getFleetMembers()
getFleetMembers in interface IFleetAIpublic DefConLocation getLocation()
getLocation in interface IUnitAICopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.