Class NewCharModel

java.lang.Object
com.realtime.crossfire.jxclient.gui.label.NewCharModel

public class NewCharModel extends Object
General information for creating new characters.
  • Field Details

  • Constructor Details

    • NewCharModel

      public NewCharModel(@NotNull @NotNull NewCharacterInformation newCharacterInformation)
      Creates a new instance.
      Parameters:
      newCharacterInformation - the new character information to use
  • Method Details

    • addListener

      public void addListener(@NotNull @NotNull NewCharModelListener listener)
      Adds a listener to notify of changes.
      Parameters:
      listener - the listener
    • removeListener

      public void removeListener(@NotNull @NotNull NewCharModelListener listener)
      Removes a listener to be notified of changes.
      Parameters:
      listener - the listener
    • getNewCharacterInformation

      @NotNull public @NotNull NewCharacterInformation getNewCharacterInformation()
      Returns the NewCharacterInformation instance received from the server.
      Returns:
      the instance
    • getRace

      @NotNull public @NotNull String getRace()
      Returns the selected race.
      Returns:
      the race
    • setRace

      public void setRace(@NotNull @NotNull String race)
      Sets the selected race.
      Parameters:
      race - the selected race
    • getClass_

      @NotNull public @NotNull String getClass_()
      Returns the selected class.
      Returns:
      the class
    • setClass

      public void setClass(@NotNull @NotNull String class_)
      Sets the selected class.
      Parameters:
      class_ - the class
    • getStartingMap

      @NotNull public @NotNull String getStartingMap()
      Returns the selected starting map.
      Returns:
      the starting map
    • setStartingMap

      public void setStartingMap(@NotNull @NotNull String startingMap)
      Sets the selected starting map.
      Parameters:
      startingMap - the starting map
    • getTotal

      public int getTotal(@NotNull @NotNull NewcharStat stat)
      Returns the total points (sum of base, race, and class) for a stat.
      Parameters:
      stat - the stat
      Returns:
      the points
    • setValue

      public void setValue(@NotNull @NotNull NewcharStat stat, int value)
      Sets the base points for a stat.
      Parameters:
      stat - the stat
      value - the points
    • getValue

      public int getValue(@NotNull @NotNull NewcharStat stat)
      Returns the base points for a stat.
      Parameters:
      stat - the stat
      Returns:
      the points
    • getRaceStatAdjustment

      public int getRaceStatAdjustment(@NotNull @NotNull NewcharStat stat)
      Returns the race points for a stat.
      Parameters:
      stat - the stat
      Returns:
      the points
    • getClassStatAdjustment

      public int getClassStatAdjustment(@NotNull @NotNull NewcharStat stat)
      Returns the class points for a stat.
      Parameters:
      stat - the stat
      Returns:
      the points
    • setErrorText

      public void setErrorText(int priority, @Nullable @Nullable String text)
      Sets an error text.
      Parameters:
      priority - the priority for deciding which error text to show
      text - the error text or null to remove the error
    • getErrorText

      @NotNull public @NotNull String getErrorText()
      Returns the error text to show.
      Returns:
      the error text or an empty string to show none
    • hasNonServerFailureErrorText

      public boolean hasNonServerFailureErrorText()
      Returns the error text to show.
      Returns:
      the error text or an empty string to show none
    • getUnusedPoints

      public int getUnusedPoints()
      Returns the number of unused attribute points.
      Returns:
      the number of unused attribute points
    • getOption

      @Nullable public @Nullable Choice getOption()
      Returns the character options.
      Returns:
      the character options or null if no options are available
    • getOptionIndex

      public int getOptionIndex()
      Return the selected character option.
      Returns:
      the option or -1 if no option is available
    • setOptionIndex

      public void setOptionIndex(int optionIndex)
      Sets the selected character option.
      Parameters:
      optionIndex - the option; invalid values are handled