Class CharacterModel
java.lang.Object
com.realtime.crossfire.jxclient.account.CharacterModel
Maintains the character list for an account. Only meaningful if the server
supports the new "loginmethod".
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(@NotNull CharacterInformation characterInformation) Adds an entry.voidaddCharacterInformationListener(int index, @NotNull CharacterInformationListener listener) Adds a character entry listener for one entry.voidaddCharacterListener(@NotNull CharacterListener listener) Adds a character listener.voidbegin()Starts an update transaction.voidcommit()Finishes an update transaction.booleandisplaysFace(int faceNum) Returns whether any character has the given face.intgetCharacterIndex(@NotNull String characterName) Returns the index of an entry by character name.@Nullable CharacterInformationgetEntry(int index) Returns a character entry by index.voidremoveCharacterInformationListener(int index, @NotNull CharacterInformationListener listener) Removes a character entry listener for one entry.voidremoveCharacterListener(@NotNull CharacterListener listener) Removes a character listener.intsize()Returns the number of character entries.
-
Constructor Details
-
CharacterModel
public CharacterModel()
-
-
Method Details
-
getEntry
Returns a character entry by index.- Parameters:
index- the index- Returns:
- the character entry, or
nullif the index is invalid
-
getCharacterIndex
Returns the index of an entry by character name.- Parameters:
characterName- the character name- Returns:
- the index, or
-1if not found
-
size
public int size()Returns the number of character entries.- Returns:
- the number of character entries
-
add
Adds an entry.- Parameters:
characterInformation- the entry to add
-
begin
public void begin()Starts an update transaction. -
commit
public void commit()Finishes an update transaction. -
addCharacterListener
Adds a character listener.- Parameters:
listener- the listener to add
-
removeCharacterListener
Removes a character listener.- Parameters:
listener- the listener to remove
-
addCharacterInformationListener
public void addCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener) Adds a character entry listener for one entry.- Parameters:
index- the entry index to monitorlistener- the listener to add
-
removeCharacterInformationListener
public void removeCharacterInformationListener(int index, @NotNull @NotNull CharacterInformationListener listener) Removes a character entry listener for one entry.- Parameters:
index- the entry index to monitorlistener- the listener to remove
-
displaysFace
public boolean displaysFace(int faceNum) Returns whether any character has the given face.- Parameters:
faceNum- the face- Returns:
- whether the face was found
-