RuneHive-Game
Loading...
Searching...
No Matches
CombatData.java
Go to the documentation of this file.
1package com.runehive.game.world.entity.combat.hit;
2
3import com.runehive.game.world.entity.combat.strategy.CombatStrategy;
4import 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 */
11public 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. */
24
25 /** Whether or not this hit is the last one. */
26 private final boolean lastHit;
27
28 /** Constructs a new {@code CombatHitData} object. */
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 */
66
67 /** @return {@code true} if this hit data is the last hit */
68 public boolean isLastHit() {
69 return lastHit;
70 }
71
72}
final CombatStrategy<? super T > strategy
The combat strategy.
CombatData(T attacker, Mob defender, CombatHit hit, CombatStrategy<? super T > strategy, boolean lastHit)
Constructs a new CombatHitData object.
final boolean lastHit
Whether or not this hit is the last one.
A wrapper for a Hit object, adding additional variables for hit and hitsplat delays.
Handles the mob class.
Definition Mob.java:66