|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectcz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot>
nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting
public abstract class AbstractWeaponShooting
Base class for all shootings. Handles setting of target and weapon prefs and
automates calling of shoot().
| Field Summary | |
|---|---|
protected static cz.cuni.amis.pogamut.base3d.worldview.object.Location |
ABOVE_PLAYER_OFFSET
Height of player, aim this much above player to shoot around shield. |
protected boolean |
active
If this shooting has been activated. |
protected static cz.cuni.amis.pogamut.base3d.worldview.object.Location |
BELOW_PLAYER_OFFSET
Half of height of player, aim this much below player to shoot at feet. |
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting.EndMessageListener |
endMessageListener
EndMessage listener |
protected static double |
FACING_ANGLE
|
protected FocusProvider |
focus
Where the shooting would like the bot to look. |
protected AgentInfo |
info
Reference to AgentInfo module. |
protected ImprovedShooting |
shoot
Reference to ImprovedShooting module. |
protected cz.cuni.amis.pogamut.base3d.worldview.object.ILocated |
target
Our target to shoot. |
protected WeaponPref |
weaponPref
Weapon pref indicates which firing mode to use. |
protected Weaponry |
weaponry
Reference to Weaponry module. |
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule |
|---|
worldView |
| Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
agent, controller, eventBus, log |
| Constructor Summary | |
|---|---|
AbstractWeaponShooting(UT2004Bot<?,?,?> agent,
AgentInfo info,
ImprovedShooting shoot,
Weaponry weaponry)
Creates an abstract WeaponShooting. |
|
| Method Summary | |
|---|---|
protected abstract WeaponPref |
getDefaultWeaponPref()
|
cz.cuni.amis.pogamut.base3d.worldview.object.ILocated |
getFocus()
Where the shooting would like the agent to look. |
ItemType |
getWeaponType()
The weapon type this module can do the shooting for. |
boolean |
hasTarget()
|
boolean |
isActive()
True when this module has been activated and is managing a weapon. |
protected boolean |
isWeaponReady()
|
protected void |
setFocus(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated focus)
Sets where the shooting would like to look. |
protected abstract void |
shoot()
Shoot will be called after every end message. |
void |
shoot(WeaponPref weaponPref,
cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)
Set target to shoot at, actual shooting is deferred to next end message. |
void |
stopShoot()
Stops the shooting. |
| Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule |
|---|
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final double FACING_ANGLE
protected static final cz.cuni.amis.pogamut.base3d.worldview.object.Location BELOW_PLAYER_OFFSET
protected static final cz.cuni.amis.pogamut.base3d.worldview.object.Location ABOVE_PLAYER_OFFSET
protected cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target
protected WeaponPref weaponPref
protected ImprovedShooting shoot
ImprovedShooting module.
protected Weaponry weaponry
Weaponry module.
protected AgentInfo info
AgentInfo module.
protected boolean active
protected FocusProvider focus
protected nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting.EndMessageListener endMessageListener
EndMessage listener
| Constructor Detail |
|---|
public AbstractWeaponShooting(UT2004Bot<?,?,?> agent,
AgentInfo info,
ImprovedShooting shoot,
Weaponry weaponry)
agent - the bot that does the shooting.info - the info module for the bot.shoot - the shooting module for the bot.weaponry - the weaponry module for the bot.| Method Detail |
|---|
public void shoot(WeaponPref weaponPref,
cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)
shoot in interface WeaponShootingplayer - protected abstract WeaponPref getDefaultWeaponPref()
public void stopShoot()
stopShoot in interface WeaponShootingprotected void setFocus(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated focus)
focus - where we want to look.public cz.cuni.amis.pogamut.base3d.worldview.object.ILocated getFocus()
getFocus in interface WeaponShootingpublic boolean hasTarget()
public ItemType getWeaponType()
getWeaponType in interface WeaponShootingpublic boolean isActive()
WeaponShooting
isActive in interface WeaponShootingprotected boolean isWeaponReady()
WeaponShooting.getWeaponType().protected abstract void shoot()
Shoot will be called after every end message.
Implementing subclasses should make a best effort attempt to shoot the given target using the given weapon preference if possible. Subclasses should take care to note that a target may not always be present. e.g. target == null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||