| 31 | import org.jetbrains.annotations.NotNull; |
| 32 | |
| 33 | public class UserChooseInformation implements ChooseInformation<String>, Chooser<String> |
| 34 | { |
| 35 | |
| 36 | public static final String UCI_NAME = "User Input"; |
| 37 | |
| 38 | /** |
| 39 | * The title (presented to the user) of this ChoiceSet |
| 40 | */ |
| 41 | private String title = null; |
| 42 | |
| 43 | @Override |
| 44 | public Class<String> getReferenceClass() |
| 45 | { |
| 46 | return String.class; |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public ChoiceManagerList<String> getChoiceManager(ChooseDriver owner, int cost) |
| 51 | { |
| 52 | return new UserInputManager(owner, this, cost); |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public GroupingState getGroupingState() |
| 57 | { |
| 58 | return GroupingState.ALLOWS_NONE; |
| 59 | } |
| 60 | |
| 61 | @Override |
| 62 | public String getLSTformat() |
| 63 | { |
| 64 | return "*USERINPUT"; |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public String getName() |
| 69 | { |
| 70 | return UCI_NAME; |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public Collection<String> getSet(PlayerCharacter pc) |
| 75 | { |
| 76 | return Collections.singletonList("USERINPUT"); |
| 77 | } |
| 78 | |
| 79 | @Override |
| 80 | public String getTitle() |
| 81 | { |
| 82 | return title == null ? "Provide User Input" : title; |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public CharSequence composeDisplay(@NotNull Collection<? extends String> collection) |
| 87 | { |
| 88 | return ChooseInformationUtilities.buildEncodedString(collection); |
| 89 | } |
| 90 |
nothing calls this directly
no outgoing calls
no test coverage detected