View Javadoc

1   package nl.tudelft.goal.ut3.selector;
2   
3   import java.util.Collection;
4   
5   import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated;
6   import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player;
7   
8   /**
9    * Selects the closest enemy {@link Player}.
10   * 
11   * @author mpkorstanje
12   *
13   */
14  public class NearestEnemy extends ContextSelector {
15  
16  
17  	@Override
18  	public ILocated select(Collection<? extends ILocated> targets) {
19  		return modules.getPlayers().getNearestVisibleEnemy();
20  	}
21  
22  	/* (non-Javadoc)
23  	 * @see java.lang.Object#toString()
24  	 */
25  	@Override
26  	public String toString() {
27  		return "NearestEnemy";
28  	}
29  
30  }