use flatland_protocol::RotationPreset;
pub const EDITOR_ABILITIES: &[&str] = &[
"unarmed",
"short_sword_slash",
"iron_sword_slash",
"bow_shot",
"arrow_shot",
"fireball",
"cone_frost",
"frost_nova",
"poison_dart",
"heal_touch",
];
const BUILTIN_PRESET_IDS: &[&str] = &["melee", "ranged", "spells"];
pub fn preset_deletable(id: &str) -> bool {
!BUILTIN_PRESET_IDS.contains(&id)
}
pub fn next_custom_preset(presets: &[RotationPreset]) -> RotationPreset {
let mut n = 1u32;
loop {
let id = format!("custom_{n}");
if !presets.iter().any(|p| p.id == id) {
return RotationPreset {
id,
label: format!("Custom {n}"),
abilities: Vec::new(),
};
}
n += 1;
}
}