diff options
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; + } +} |