Class CharacterModel

java.lang.Object
com.realtime.crossfire.jxclient.account.CharacterModel

public class CharacterModel extends Object
Maintains the character list for an account. Only meaningful if the server supports the new "loginmethod".
  • Constructor Details

    • CharacterModel

      public CharacterModel()
  • Method Details

    • getEntry

      @Nullable public @Nullable CharacterInformation getEntry(int index)
      Returns a character entry by index.
      Parameters:
      index - the index
      Returns:
      the character entry, or null if the index is invalid
    • getCharacterIndex

      public int getCharacterIndex(@NotNull @NotNull String characterName)
      Returns the index of an entry by character name.
      Parameters:
      characterName - the character name
      Returns:
      the index, or -1 if not found
    • size

      public int size()
      Returns the number of character entries.
      Returns:
      the number of character entries
    • add

      public void add(@NotNull @NotNull CharacterInformation characterInformation)
      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

      public void addCharacterListener(@NotNull @NotNull CharacterListener listener)
      Adds a character listener.
      Parameters:
      listener - the listener to add
    • removeCharacterListener

      public void removeCharacterListener(@NotNull @NotNull CharacterListener listener)
      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 monitor
      listener - 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 monitor
      listener - 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