/** * Given pos1 the attack values are calculated between it and the positions held in 'owns' (pos2). * the attack_value and pos2 are then added to result[] and added to pos1's 'targets' vector. */ public void calcAttackValue(RCSInfluenceMapPosition pos1, String[] noAttack) { RCSInfluenceMapPosition pos2; double attack_value; for (int i = 0; i < owns.size(); i++) { pos2 = (RCSInfluenceMapPosition) owns.elementAt(i); if (isMember(pos2.getType(), noAttack) == false) { attack_value = (pos1.getTotalValue() - pos2.getTotalValue()) / java.awt.geom.Point2D.distance( pos1.getCenter()[0], pos1.getCenter()[1], pos2.getCenter()[0], pos2.getCenter()[1]); pos1.addDoubleHigh(pos1.getTargets(), new objectTarget(attack_value, pos2)); } } }