Crossfire JXClient, Trunk
com.realtime.crossfire.jxclient.main.PlayerNameTracker Class Reference

Tracks a GuiStateManager and updates a JXCConnection's character name. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.main.PlayerNameTracker:

Public Member Functions

 PlayerNameTracker (@NotNull final GuiStateManager guiStateManager, @NotNull final JXCConnection connection, @NotNull final ItemSet itemSet)
 Creates a new instance. More...
 

Private Attributes

final JXCConnection connection
 The JXCConnection to track. More...
 
final GuiStateListener guiStateListener
 The GuiStateListener for detecting established or dropped connections. More...
 
final ItemSet itemSet
 The ItemSet to track. More...
 
final ItemSetListener itemSetListener
 The listener to detect a changed player name. More...
 

Detailed Description

Tracks a GuiStateManager and updates a JXCConnection's character name.

Author
Andreas Kirschbaum

Definition at line 40 of file PlayerNameTracker.java.

Constructor & Destructor Documentation

◆ PlayerNameTracker()

com.realtime.crossfire.jxclient.main.PlayerNameTracker.PlayerNameTracker ( @NotNull final GuiStateManager  guiStateManager,
@NotNull final JXCConnection  connection,
@NotNull final ItemSet  itemSet 
)

Creates a new instance.

Parameters
guiStateManagerthe gui state manager to track
connectionthe connection to track
itemSetthe item set to track

Definition at line 123 of file PlayerNameTracker.java.

References com.realtime.crossfire.jxclient.main.PlayerNameTracker.connection, com.realtime.crossfire.jxclient.main.PlayerNameTracker.guiStateListener, and com.realtime.crossfire.jxclient.main.PlayerNameTracker.itemSet.

Member Data Documentation

◆ connection

final JXCConnection com.realtime.crossfire.jxclient.main.PlayerNameTracker.connection
private

◆ guiStateListener

final GuiStateListener com.realtime.crossfire.jxclient.main.PlayerNameTracker.guiStateListener
private

The GuiStateListener for detecting established or dropped connections.

Definition at line 78 of file PlayerNameTracker.java.

Referenced by com.realtime.crossfire.jxclient.main.PlayerNameTracker.PlayerNameTracker().

◆ itemSet

final ItemSet com.realtime.crossfire.jxclient.main.PlayerNameTracker.itemSet
private

◆ itemSetListener

final ItemSetListener com.realtime.crossfire.jxclient.main.PlayerNameTracker.itemSetListener
private
Initial value:
= new ItemSetListener() {
@Override
public void playerChanged(@Nullable final CfItem player) {
connection.setCharacter(player == null ? null : player.getName());
}
@Override
public void openContainerChanged(final int tag) {
}
}

The listener to detect a changed player name.

Definition at line 58 of file PlayerNameTracker.java.


The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.main.PlayerNameTracker.connection
final JXCConnection connection
The JXCConnection to track.
Definition: PlayerNameTracker.java:46
com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter
void setCharacter(@Nullable final String character)
Updates the active character name.
Definition: JXCConnection.java:222