package me.sashegdev.blackknife; import java.util.ArrayList; import java.util.List; import java.util.UUID; public class MagicProfile { public String nick; public UUID uuid; public long firstSeen; public int casts; public double tpSpent; public int heals; public int selectedIdx; public List common = new ArrayList<>(List.of("DETERMORE","FROSHE","PRAYER","SHIELDO")); public List rare = new ArrayList<>(); public List story = new ArrayList<>(); public boolean rareRolled; public MagicProfile(String nick, UUID uuid) { this.nick = nick; this.uuid = uuid; this.firstSeen = System.currentTimeMillis(); } public List all() { List out = new ArrayList<>(); for (String s : common) try { out.add(MagicType.valueOf(s)); } catch (Exception ignored) {} for (String s : rare) try { out.add(MagicType.valueOf(s)); } catch (Exception ignored) {} for (String s : story) try { out.add(MagicType.valueOf(s)); } catch (Exception ignored) {} if (out.isEmpty()) out.add(MagicType.DETERMORE); return out; } public MagicType getSelected() { List a = all(); if (selectedIdx < 0 || selectedIdx >= a.size()) selectedIdx = 0; return a.get(selectedIdx); } public void cycle() { List a = all(); selectedIdx = (selectedIdx + 1) % a.size(); } }