 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.gui.commands;
34 import java.util.ArrayList;
35 import java.util.Collection;
36 import java.util.Iterator;
37 import org.jetbrains.annotations.NotNull;
97 if (loginField ==
null) {
101 final String login = loginField.
getText();
102 if (login.isEmpty()) {
107 final Collection<String> attributes =
new ArrayList<>();
115 if (option !=
null) {
117 final Iterator<String> it = option.
getChoices().keySet().iterator();
118 for (
int i = 0; i < optionIndex; i++) {
121 attributes.add(
"choice "+option.
getChoiceName()+
" "+it.next());
Abstract base class for text input fields.
final NewCharModel newCharModel
The global NewCharModel instance.
Combines a list of GUIElements to for a gui.
Gui getGui(@NotNull final AbstractGUIElement element)
Returns the Gui an element is part of.
int getValue(@NotNull final NewcharStat stat)
Returns the base points for a stat.
final GuiFactory guiFactory
The global GuiFactory instance.
Abstract base class for GUI elements to be shown in Guis.
String getChoiceName()
Returns the choice identification.
final AbstractGUIElement element
The AbstractGUIElement to find the Gui containing the fields.
int getOptionIndex()
Return the selected character option.
void accountCreateCharacter(@NotNull String login, @NotNull Collection< String > attributes)
Creates a character.
String getClass_()
Returns the selected class.
A choice for character creation.
void execute()
Executes the command.
General information for creating new characters.
final CommandCallback commandCallback
The CommandCallback to use.
AccountCreateCharacterCommand(@NotNull final CommandCallback commandCallback, @NotNull final AbstractGUIElement button, @NotNull final GuiFactory guiFactory, @NotNull final NewCharModel newCharModel)
Creates a new instance.
Factory for creating Gui instances.
boolean canExecute()
Returns whether this command may be executed.
Interface that defines callback functions needed by commands.
String getRace()
Returns the selected race.
Choice getOption()
Returns the character options.
A GUICommand sending a character creation request.
public< T extends GUIElement > T getFirstElement(@NotNull final Class< T > class_)
Returns the first gui element of this gui belonging to the given class.
String getText()
Returns the entered text.
String getStartingMap()
Returns the selected starting map.
void setActive(final boolean active)
Sets the active state of a GUI element.
Map< String, String > getChoices()
Returns the choices.