View Javadoc

1   package nl.tudelft.pogamut.ut2004.agent.module.shooting;
2   
3   import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated;
4   import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPref;
5   import cz.cuni.amis.pogamut.ut2004.agent.module.sensor.WeaponPrefs;
6   import cz.cuni.amis.pogamut.ut2004.communication.messages.ItemType;
7   
8   /**
9    * Implementing modulus should provide a simple way to efficiently utilize the
10   * weapons in unreal tournament. This includes using charging weapons and using
11   * combos.
12   * 
13   * @author mpkorstanje
14   * 
15   */
16  public interface WeaponShooting {
17  
18  	/**
19  	 * Shoots a given target in an effective way. The weapon preference is only
20  	 * used to determine which fire mode is preferred. The weapon use is
21  	 * determined by {@link WeaponShooting#getWeaponType()}.
22  	 * 
23  	 * Callers should make sure that the weapon used by Shoot is available and
24  	 * has sufficient ammo. (Generally through using {@link WeaponPrefs}).
25  	 * 
26  	 * While a target is given, shooting will try to attack this target however
27  	 * it may smartly refuse to shoot if the target is no longer visible. It may
28  	 * not refuse to stop shooting at targets that are out of range, the
29  	 * {@link WeaponPrefs} module should make this decision.
30  	 * 
31  	 * @param weaponPref
32  	 *            the preferred firing mode to use. Weapon use is determined by
33  	 *            module.
34  	 * @param target
35  	 *            to shoot.
36  	 */
37  	public void shoot(WeaponPref weaponPref, ILocated target);
38  
39  	/**
40  	 * Stops the shooting. This may result in the discharge when a weapon has
41  	 * been charging.
42  	 * 
43  	 * TODO: Modules should handle this gracefully.
44  	 */
45  	public void stopShoot();
46  
47  	/**
48  	 * The weapon type this module can do the shooting for.
49  	 * 
50  	 * @return the weapon type we'll shoot with.
51  	 */
52  	public ItemType getWeaponType();
53  
54  	/**
55  	 * True when this module has been activated and is managing a weapon.
56  	 * 
57  	 * @return true when this module has been activated and is managing a
58  	 *         weapon.
59  	 */
60  	public boolean isActive();
61  
62  	/**
63  	 * Should return a self updating object that indicates where the owner wants
64  	 * to focus.
65  	 * 
66  	 * @return a focus indicating where the owner wants to focus.
67  	 */
68  	public ILocated getFocus();
69  
70  
71  }