44 lines
1.4 KiB
Java
44 lines
1.4 KiB
Java
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<String> common = new ArrayList<>(List.of("DETERMORE","FROSHE","PRAYER","SHIELDO"));
|
|
public List<String> rare = new ArrayList<>();
|
|
public List<String> story = new ArrayList<>();
|
|
public boolean rareRolled;
|
|
|
|
public MagicProfile(String nick, UUID uuid) {
|
|
this.nick = nick; this.uuid = uuid; this.firstSeen = System.currentTimeMillis();
|
|
}
|
|
|
|
public List<MagicType> all() {
|
|
List<MagicType> 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<MagicType> a = all();
|
|
if (selectedIdx < 0 || selectedIdx >= a.size()) selectedIdx = 0;
|
|
return a.get(selectedIdx);
|
|
}
|
|
|
|
public void cycle() {
|
|
List<MagicType> a = all();
|
|
selectedIdx = (selectedIdx + 1) % a.size();
|
|
}
|
|
}
|