diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/console/AvatarDialogTest.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/console/AvatarDialogTest.java')
| -rw-r--r-- | NET/worlds/console/AvatarDialogTest.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/NET/worlds/console/AvatarDialogTest.java b/NET/worlds/console/AvatarDialogTest.java new file mode 100644 index 0000000..4587c87 --- /dev/null +++ b/NET/worlds/console/AvatarDialogTest.java @@ -0,0 +1,43 @@ +package NET.worlds.console; + +import java.util.Vector; + +public class AvatarDialogTest implements AvatarDialogCallback { + private static final String[] components = new String[]{"Color", "Weather", "Height", "Shape"}; + private static final String[] colors = new String[]{"Red", "Orange", "Yellow", "Green", "Blue", "Violet"}; + private static final String[] weather = new String[]{"Sunny", "Cloudy", "Raining", "Snowing"}; + private static final String[] heights = new String[]{"Short", "Medium", "Tall"}; + private static final String[] shapes = new String[]{"Circle", "Rectangle", "Triangle"}; + private static final String[][] items = new String[][]{colors, weather, heights, shapes}; + private static int[] settings = new int[components.length]; + + @Override + public Vector<String> getComponents() { + return stringsToVector(components); + } + + @Override + public Vector<String> getChoices(int index) { + return stringsToVector(items[index]); + } + + @Override + public int getCurrentSelection(int index) { + return settings[index]; + } + + @Override + public void setCurrentSelection(int index, int choice) { + settings[index] = choice; + } + + private static Vector<String> stringsToVector(String[] strings) { + Vector<String> v = new Vector<String>(); + + for (int i = 0; i < strings.length; i++) { + v.addElement(strings[i]); + } + + return v; + } +} |