* shoot.
*
* @return an AttackInfo-object as described
*/
private AttackInfo getNextAttackInfo() {
TimeRules timeRules = Game.getGame().getTimeRules();
int minTime = Integer.MAX_VALUE;
AttackInfo bestAttackInfo = null;
// CAUTION: Time decreases, so the later a time, the smaller its value
// On the time-axis:
//
// [ timeOfNextShot ]
// [ dt ] [ currTime ]
// -------|---------------------|------------------------|------------>
// currAttMapObjectTime startTime
for (Attacking attacking : allAttackers.keySet()) {
if (defAttackers.containsKey(attacking)
&& !(attacking.canStillShootAsDefender())) {
// Our Attacking is a defender, which can't shoot any longer
continue;
}
AttMapObjectInfo attMapObjectInfo = allAttackers.get(attacking);
// the internal time of the current attMapObject when the combat
// started
int startTime = attMapObjectInfo.startTime;
// the internal time the current attMapObject has now
int currAttMapObjectTime = startTime - currTime;
// When can the current attacking shoot again?
int timeOfNextShot = attacking.getTimeOfNextShot();
int dt = timeOfNextShot - currTime;
if (attAttackers.containsKey(attacking)
&& !(timeRules.isActionAllowed(dt, currAttMapObjectTime))) {
continue;
}
if (timeOfNextShot < minTime) {
minTime = timeOfNextShot;