RuneHive-Game
Loading...
Searching...
No Matches
CombatData.java
Go to the documentation of this file.
1
package
com.runehive.game.world.entity.combat.hit;
2
3
import
com.runehive.game.world.entity.combat.strategy.CombatStrategy;
4
import
com.runehive.game.world.entity.mob.Mob;
5
6
/**
7
* Holds variables to generate combat data of an actor.
8
*
9
* @author Michael | Chex
10
*/
11
public
final
class
CombatData
<T
extends
Mob
> {
12
13
/** The attacker. */
14
private
final
T
attacker
;
15
16
/** The defender. */
17
private
final
Mob
defender
;
18
19
/** The combat hit. */
20
private
final
CombatHit
hit
;
21
22
/** The combat strategy. */
23
private
final
CombatStrategy<? super T>
strategy
;
24
25
/** Whether or not this hit is the last one. */
26
private
final
boolean
lastHit
;
27
28
/** Constructs a new {@code CombatHitData} object. */
29
public
CombatData
(T
attacker
,
Mob
defender
,
CombatHit
hit
,
CombatStrategy<? super T>
strategy
,
boolean
lastHit
) {
30
this.attacker =
attacker
;
31
this.defender =
defender
;
32
this.hit =
hit
;
33
this.strategy =
strategy
;
34
this.lastHit =
lastHit
;
35
}
36
37
/** @return the attacker */
38
public
T
getAttacker
() {
39
return
attacker
;
40
}
41
42
/** @return the defender */
43
public
Mob
getDefender
() {
44
return
defender
;
45
}
46
47
/** @return the hit */
48
public
CombatHit
getHit
() {
49
return
hit
;
50
}
51
52
/** @return the hit delay. */
53
public
int
getHitDelay
() {
54
return
hit
.getHitDelay();
55
}
56
57
/** @return the hitsplat delay. */
58
public
int
getHitsplatDelay
() {
59
return
hit
.getHitsplatDelay();
60
}
61
62
/** @return the combat strategy */
63
public
CombatStrategy<? super T>
getStrategy
() {
64
return
strategy
;
65
}
66
67
/** @return {@code true} if this hit data is the last hit */
68
public
boolean
isLastHit
() {
69
return
lastHit
;
70
}
71
72
}
com.runehive.game.world.entity.combat.hit.CombatData.getStrategy
CombatStrategy<? super T > getStrategy()
Definition
CombatData.java:63
com.runehive.game.world.entity.combat.hit.CombatData.attacker
final T attacker
The attacker.
Definition
CombatData.java:14
com.runehive.game.world.entity.combat.hit.CombatData.getAttacker
T getAttacker()
Definition
CombatData.java:38
com.runehive.game.world.entity.combat.hit.CombatData.getDefender
Mob getDefender()
Definition
CombatData.java:43
com.runehive.game.world.entity.combat.hit.CombatData.strategy
final CombatStrategy<? super T > strategy
The combat strategy.
Definition
CombatData.java:23
com.runehive.game.world.entity.combat.hit.CombatData.CombatData
CombatData(T attacker, Mob defender, CombatHit hit, CombatStrategy<? super T > strategy, boolean lastHit)
Constructs a new CombatHitData object.
Definition
CombatData.java:29
com.runehive.game.world.entity.combat.hit.CombatData.getHit
CombatHit getHit()
Definition
CombatData.java:48
com.runehive.game.world.entity.combat.hit.CombatData.getHitsplatDelay
int getHitsplatDelay()
Definition
CombatData.java:58
com.runehive.game.world.entity.combat.hit.CombatData.lastHit
final boolean lastHit
Whether or not this hit is the last one.
Definition
CombatData.java:26
com.runehive.game.world.entity.combat.hit.CombatData.defender
final Mob defender
The defender.
Definition
CombatData.java:17
com.runehive.game.world.entity.combat.hit.CombatData.hit
final CombatHit hit
The combat hit.
Definition
CombatData.java:20
com.runehive.game.world.entity.combat.hit.CombatData.getHitDelay
int getHitDelay()
Definition
CombatData.java:53
com.runehive.game.world.entity.combat.hit.CombatData.isLastHit
boolean isLastHit()
Definition
CombatData.java:68
com.runehive.game.world.entity.combat.hit.CombatHit
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
Definition
CombatHit.java:11
com.runehive.game.world.entity.combat.strategy.CombatStrategy
Definition
CombatStrategy.java:21
com.runehive.game.world.entity.mob.Mob
Handles the mob class.
Definition
Mob.java:66