public class PoisonWatcher
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
active
Whether poisoning is active.
|
private static java.lang.String |
ASSERT_MESSAGE
The text message the server sends in poisoned state.
|
private static java.lang.String |
CURE_MESSAGE
The text message the server sends when the poison is cured via a spell.
|
private static java.lang.String |
DE_ASSERT_MESSAGE
The text message the server sends when the poison wears off.
|
private CrossfireDrawextinfoListener |
drawextinfoListener
The drawextinfo listener to receive drawextinfo messages.
|
private CrossfireDrawinfoListener |
drawinfoListener
The drawinfo listener to receive drawinfo messages.
|
private Stats |
stats
The stats instance to notify.
|
private java.lang.Object |
sync
The object used for synchronization.
|
private static int |
TIMEOUT_DE_ASSERT
Timeout after that the "poisoned" state is reset.
|
private java.awt.event.ActionListener |
timeoutEvent
The timeout event used to turn off poisoning if the de-assert message was
missed.
|
private javax.swing.Timer |
timer
The
Timer for turning off the poison symbol. |
Constructor and Description |
---|
PoisonWatcher(Stats stats,
CrossfireServerConnection crossfireServerConnection)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
private void |
check(java.lang.String message)
Examines a text message.
|
private void |
setActive(boolean active)
Sets the current poisoned state.
|
private boolean active
@NotNull private static final java.lang.String ASSERT_MESSAGE
@NotNull private static final java.lang.String CURE_MESSAGE
@NotNull private static final java.lang.String DE_ASSERT_MESSAGE
@NotNull private final CrossfireDrawextinfoListener drawextinfoListener
@NotNull private final CrossfireDrawinfoListener drawinfoListener
@NotNull private final Stats stats
@NotNull private final java.lang.Object sync
private static final int TIMEOUT_DE_ASSERT
@NotNull private final java.awt.event.ActionListener timeoutEvent
@NotNull private final javax.swing.Timer timer
Timer
for turning off the poison symbol.public PoisonWatcher(@NotNull Stats stats, @NotNull CrossfireServerConnection crossfireServerConnection)
stats
- the stats instance to notifycrossfireServerConnection
- the connection to watch