Class NewCharModel
java.lang.Object
com.realtime.crossfire.jxclient.gui.label.NewCharModel
General information for creating new characters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String).static final intA priority value forsetErrorText(int, String). -
Constructor Summary
ConstructorsConstructorDescriptionNewCharModel(@NotNull NewCharacterInformation newCharacterInformation) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(@NotNull NewCharModelListener listener) Adds a listener to notify of changes.@NotNull StringReturns the selected class.intgetClassStatAdjustment(@NotNull NewcharStat stat) Returns the class points for a stat.@NotNull StringReturns the error text to show.@NotNull NewCharacterInformationReturns theNewCharacterInformationinstance received from the server.@Nullable ChoiceReturns the character options.intReturn the selected character option.@NotNull StringgetRace()Returns the selected race.intgetRaceStatAdjustment(@NotNull NewcharStat stat) Returns the race points for a stat.@NotNull StringReturns the selected starting map.intgetTotal(@NotNull NewcharStat stat) Returns the total points (sum of base, race, and class) for a stat.intReturns the number of unused attribute points.intgetValue(@NotNull NewcharStat stat) Returns the base points for a stat.booleanReturns the error text to show.voidremoveListener(@NotNull NewCharModelListener listener) Removes a listener to be notified of changes.voidSets the selected class.voidsetErrorText(int priority, @Nullable String text) Sets an error text.voidsetOptionIndex(int optionIndex) Sets the selected character option.voidSets the selected race.voidsetStartingMap(@NotNull String startingMap) Sets the selected starting map.voidsetValue(@NotNull NewcharStat stat, int value) Sets the base points for a stat.
-
Field Details
-
PRIORITY_INVALID_STAT_STR
public static final int PRIORITY_INVALID_STAT_STRA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_DEX
public static final int PRIORITY_INVALID_STAT_DEXA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_CON
public static final int PRIORITY_INVALID_STAT_CONA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_INT
public static final int PRIORITY_INVALID_STAT_INTA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_WIS
public static final int PRIORITY_INVALID_STAT_WISA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_POW
public static final int PRIORITY_INVALID_STAT_POWA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_INVALID_STAT_CHA
public static final int PRIORITY_INVALID_STAT_CHAA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_UNUSED_POINTS
public static final int PRIORITY_UNUSED_POINTSA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_CHARACTER_NAME
public static final int PRIORITY_CHARACTER_NAMEA priority value forsetErrorText(int, String).- See Also:
-
PRIORITY_SERVER_FAILURE
public static final int PRIORITY_SERVER_FAILUREA priority value forsetErrorText(int, String).- See Also:
-
-
Constructor Details
-
NewCharModel
Creates a new instance.- Parameters:
newCharacterInformation- the new character information to use
-
-
Method Details
-
addListener
Adds a listener to notify of changes.- Parameters:
listener- the listener
-
removeListener
Removes a listener to be notified of changes.- Parameters:
listener- the listener
-
getNewCharacterInformation
Returns theNewCharacterInformationinstance received from the server.- Returns:
- the instance
-
getRace
Returns the selected race.- Returns:
- the race
-
setRace
Sets the selected race.- Parameters:
race- the selected race
-
getClass_
Returns the selected class.- Returns:
- the class
-
setClass
Sets the selected class.- Parameters:
class_- the class
-
getStartingMap
Returns the selected starting map.- Returns:
- the starting map
-
setStartingMap
Sets the selected starting map.- Parameters:
startingMap- the starting map
-
getTotal
Returns the total points (sum of base, race, and class) for a stat.- Parameters:
stat- the stat- Returns:
- the points
-
setValue
Sets the base points for a stat.- Parameters:
stat- the statvalue- the points
-
getValue
Returns the base points for a stat.- Parameters:
stat- the stat- Returns:
- the points
-
getRaceStatAdjustment
Returns the race points for a stat.- Parameters:
stat- the stat- Returns:
- the points
-
getClassStatAdjustment
Returns the class points for a stat.- Parameters:
stat- the stat- Returns:
- the points
-
setErrorText
Sets an error text.- Parameters:
priority- the priority for deciding which error text to showtext- the error text ornullto remove the error
-
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
Returns the character options.- Returns:
- the character options or
nullif no options are available
-
getOptionIndex
public int getOptionIndex()Return the selected character option.- Returns:
- the option or
-1if no option is available
-
setOptionIndex
public void setOptionIndex(int optionIndex) Sets the selected character option.- Parameters:
optionIndex- the option; invalid values are handled
-