spinners and fmt
This commit is contained in:
@@ -22,6 +22,10 @@ pub(crate) const BUILTIN_TAG_PREFIX: &str = "BUILTIN_";
|
||||
/// direction comes from the object's tag, so all pushers share one compiled AST.
|
||||
const PUSHER: &str = include_str!("scripts/pusher.rhai");
|
||||
|
||||
/// The spinner behavior, embedded into the binary. Shared by both spin directions —
|
||||
/// direction comes from the object's tag, so all spinners share one compiled AST.
|
||||
const SPINNER: &str = include_str!("scripts/spinner.rhai");
|
||||
|
||||
/// The tag identifying an object as the expanded form of `arch`, e.g.
|
||||
/// `"BUILTIN_pusher_east"`.
|
||||
pub(crate) fn builtin_tag(arch: Archetype) -> String {
|
||||
@@ -41,6 +45,7 @@ pub(crate) fn archetype_from_builtin_tag(tag: &str) -> Option<Archetype> {
|
||||
pub(crate) fn archetype_script(arch: Archetype) -> Option<&'static str> {
|
||||
match arch {
|
||||
Archetype::Pusher(_) => Some(PUSHER),
|
||||
Archetype::Spinner(_) => Some(SPINNER),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user