cz.cuni.amis.pogamut.defcon.example
Class MixedFleetAI
java.lang.Object
cz.cuni.amis.pogamut.defcon.ai.AbstractAI
cz.cuni.amis.pogamut.defcon.example.MixedFleetAI
- All Implemented Interfaces:
- IFleetAI, IUnitAI
public class MixedFleetAI
- extends AbstractAI
- implements IFleetAI
MixedFleetAI
- Author:
- Radek 'Black_Hand' Pibil
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fleet
protected final Fleet fleet
targetLocation
protected DefConLocation targetLocation
optimizedTargetLocation
protected DefConLocation optimizedTargetLocation
currentTargetLocation
protected DefConLocation currentTargetLocation
originalLocation
protected DefConLocation originalLocation
enemyCityIds
protected final List<Integer> enemyCityIds
canLaunch
protected boolean canLaunch
arrivalTime
protected float arrivalTime
currentState
protected MixedFleetAI.State currentState
level3DefconListener
protected final cz.cuni.amis.pogamut.base.communication.worldview.event.IWorldEventListener<DefConChanged> level3DefconListener
TARGET_SELECTION_LIMIT
protected static final double TARGET_SELECTION_LIMIT
- See Also:
- Constant Field Values
targetFleet
protected Fleet targetFleet
lastTargetSelect
protected float lastTargetSelect
MixedFleetAI
public MixedFleetAI(DefConLocation target,
Fleet fleet,
ExampleBotLogicController logic)
optimizeOriginalLocation
protected void optimizeOriginalLocation()
setMoveToTarget
protected void setMoveToTarget()
moveFleet
protected void moveFleet(DefConLocation target)
update
public void update()
- Specified by:
update in interface IUnitAI
runGotoAttackPosition
protected void runGotoAttackPosition()
runLaunchNukes
protected void runLaunchNukes()
runHunt
protected void runHunt()
setAttackTarget
protected void setAttackTarget(int targetId)
refreshClosestEnemyFleet
protected void refreshClosestEnemyFleet()
caculateBestMovementTarget
protected void caculateBestMovementTarget()
getClosestEnemyCityOwner
protected int getClosestEnemyCityOwner(DefConLocation closestTo)
arrayToString
protected String arrayToString(int[] array)
inNukeRange
protected boolean inNukeRange(int unitId,
int cityId,
UnitType type)
inNukeRange
protected boolean inNukeRange(DefConLocation unit,
DefConLocation target,
UnitType type)
launchNuke
protected void launchNuke(int unitId,
int targetId)
nukeCapable
protected boolean nukeCapable(int unitId)
inNukeState
protected boolean inNukeState(int unitId)
toNukeState
protected boolean toNukeState(int unitId)
hasSpareNukes
protected boolean hasSpareNukes()
hasSpareLaunchableNukes
protected boolean hasSpareLaunchableNukes()
getFleet
public final Fleet getFleet()
getLogic
public final ExampleBotLogicController getLogic()
setTargetLocation
public void setTargetLocation(DefConLocation target)
- Specified by:
setTargetLocation in interface IFleetAI
getClosestEnemyFleet
public Fleet getClosestEnemyFleet()
- Returns the closest visible enemy fleet.
- Returns:
- closest visible enemy fleet
getClosestEnemyFleetWithUnit
public Fleet getClosestEnemyFleetWithUnit(UnitType type)
- Returns the closest visible enemy fleet with given unit type.
- Parameters:
type - unitetype the enemy fleet has to contain
- Returns:
- closest visible enemy fleet with given unitetype
getClosestEnemyFleetWithUnits
public Fleet getClosestEnemyFleetWithUnits(UnitType[] types)
- Returns the closest visible enemy fleet with given unit type.
- Parameters:
type - unitetype the enemy fleet has to contain
- Returns:
- closest visible enemy fleet with given unitetype
dispose
public void dispose()
- Specified by:
dispose in interface IUnitAI- Overrides:
dispose in class AbstractAI
arrayContains
protected <T> boolean arrayContains(T[] array,
T element)
arrayIndex
protected <T> int arrayIndex(T[] array,
T element)
getFleetMembers
public int[] getFleetMembers()
- Specified by:
getFleetMembers in interface IFleetAI
getLocation
public DefConLocation getLocation()
- Specified by:
getLocation in interface IUnitAI
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.