Fixing tests and comments

This commit is contained in:
2026-07-05 23:41:19 -05:00
parent c16b21c603
commit b7063277e7
8 changed files with 214 additions and 174 deletions
+4 -3
View File
@@ -28,7 +28,7 @@
//! `move(dir)`, `delay(secs)`, `now()`, `set_tile(n)`, `log(msg)`, `say(msg)`,
//! `set_fg(fg)`, `set_bg(bg)`, `set_color(fg, bg)`, `set_tag(target, tag, present)`,
//! `send(target_id, fn_name [, arg])`, `teleport(x, y)`, `push(x, y, dir)`,
//! `swap([[src_x, src_y, dst_x, dst_y], …])`, `add_gems(n)`, `alter_health(dh)`, `set_key(color, present)`, `die()`
//! `shift([[x, y], …])`, `add_gems(n)`, `alter_health(dh)`, `set_key(color, present)`, `die()`
use crate::action::{Action, BoardAction, ScrollLine, SendArg, MOVE_COST};
use crate::game::SAY_DURATION;
@@ -691,8 +691,9 @@ fn register_global_constants(engine: &mut Engine) {
engine.register_global_module(m.into());
}
/// Builds a fresh per-object scope containing only the object-specific handles:
/// the Board view, the object's Queue, and the Me self-reference.
/// Builds a fresh per-object scope containing only the `Registry` handle. The
/// per-object `me` (an [`ObjectInfo`]) and `state` (a [`ScriptState`]) views are
/// passed as hook parameters, not scope constants.
fn new_object_scope(board: &BoardRef) -> Scope<'static> {
let mut scope = Scope::new();
scope.push_constant("Registry", Registry { board: board.clone() });