Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package data;
- import java.util.Arrays;
- import java.util.LinkedHashMap;
- public enum WeaponClass {
- UNARMED(0, new String[] {
- "Punch", "Kick", "Block"
- }, new int[] {
- 0, 1, 3
- }),
- AXE_BATTLEAXE(1, new String[] {
- "Chop", "Hack", "Smash", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- WARHAMMER(2, new String[] {
- "Pound", "Pummel", "Block"
- }, new int[] {
- 0, 1, 3
- }),
- BOW(3, new String[] {
- "Accurate", "Rapid", "Longrange"
- }, new int[] {
- 0, 1, 3
- }),
- CLAWS(4, new String[] {
- "Chop", "Slash", "Lunge", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- CROSSBOW(5, new String[] {
- "Accurate", "Rapid", "Longrange"
- }, new int[] {
- 0, 1, 3
- }),
- SALAMANDER(6, new String[] {}, new int[] {}),
- CHINCHOMPA(7, new String[] {}, new int[] {}),
- LONGSWORD_SCIMITAR(9, new String[] {
- "Chop", "Slash", "Lunge", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- PICKAXE(11, new String[] {
- "Spike", "Impale", "Smash", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- HALBERD(12, new String[] {
- "Jab", "Swipe", "Fend"
- }, new int[] {
- 0, 1, 3
- }),
- SPEAR(15, new String[] {
- "Lunge", "Swipe", "Pound", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- MACE(16, new String[] {
- "Pound", "Pummel", "Spike", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- DAGGER_SWORD(17, new String[] {
- "Stab", "Lunge", "Slash", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- STAFF(18, new String[] {
- "Bash", "Pound", "Focus"
- }, new int[] {
- 0, 1, 3
- }),
- THROWN(19, new String[] {
- "Accurate", "Rapid", "Longrange"
- }, new int[] {
- 0, 1, 3
- }),
- WHIP(20, new String[] {}, new int[] {}),
- SOTD(21, new String[] {}, new int[] {}),
- TWO_HANDED(22, new String[] {
- "Chop", "Slash", "Smash", "Block"
- }, new int[] {
- 0, 1, 2, 3
- }),
- TOTS(23, new String[] {}, new int[] {}),
- GREEGREE(24, new String[] {}, new int[] {});
- private int id;
- private LinkedHashMap<Integer, String> styles;
- public int getId() {
- return id;
- }
- WeaponClass(int id, String[] styles, int[] configs) {
- this.id = id;
- this.styles = new LinkedHashMap<>();
- for (int i = 0; i < styles.length; i++) {
- this.styles.put(configs[i], styles[i]);
- }
- }
- public static WeaponClass forId(int id) {
- return Arrays.asList(values()).stream().filter(c -> c.id == id).findFirst().orElse(null);
- }
- public String getName(int config) {
- return styles.get(config);
- }
- public int getConfig(String style) {
- return styles.keySet().stream().filter(c -> styles.get(c).equals(style)).findFirst().orElse(-1);
- }
- public String[] styles() {
- return styles.values().stream().toArray(String[]::new);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement