E
- The entity type used.A
- The attacker type used.W
- The weapon type used.public class AttackerModel<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>> extends AbilityModel<AttackerListener<E>,A> implements AttackerServices<E,A,W>
listeners, user
Constructor and Description |
---|
AttackerModel(A user)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addWeapon(W weapon,
int id)
Add a weapon.
|
void |
attack(E target)
Define a target to attack.
|
W |
getWeapon(int id)
Get a weapon from its id.
|
boolean |
isAttacking()
Check if currently attacking.
|
void |
removeWeapon(int id)
Remove a weapon.
|
void |
setWeapon(int id)
Set the current weapon to use.
|
void |
stopAttack()
Stop current weapon attack.
|
void |
updateAttack(double extrp)
Update attack routine.
|
addListener, removeListener
public AttackerModel(A user)
user
- The ability user reference.public void addWeapon(W weapon, int id)
AttackerServices
addWeapon
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
weapon
- The weapon instance.id
- The weapon index number.public void removeWeapon(int id)
AttackerServices
removeWeapon
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
id
- The weapon to remove from its index number.public W getWeapon(int id)
AttackerServices
getWeapon
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
id
- The weapon id.public void setWeapon(int id)
AttackerServices
setWeapon
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
id
- The weapon to use from its index number.public void attack(E target)
AttackerServices
attack
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
target
- The target to attack.public void stopAttack()
AttackerServices
stopAttack
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
public void updateAttack(double extrp)
AttackerServices
updateAttack
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
extrp
- The extrapolation value.public boolean isAttacking()
AttackerServices
isAttacking
in interface AttackerServices<E extends EntityStrategy,A extends AttackerUsedServices<E>,W extends WeaponServices<E,A>>
true
if attacking, false
else.Copyright © 2014 Byron 3D Games Studio. All rights reserved.