new layer model

This commit is contained in:
2026-07-10 23:16:28 -05:00
parent 325d2c27dd
commit ad95a9cd8d
36 changed files with 1040 additions and 897 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ use rhai::Engine;
use crate::api::board::BoardRef;
use crate::player::PlayerRef;
use crate::script::Registerable;
use crate::utils::ErrorSink;
use crate::utils::LogSink;
/// GameState stores player state but Board stores its position, and we want one
/// object to register with Rhai
@@ -10,7 +10,7 @@ use crate::utils::ErrorSink;
pub struct PlayerWithPos(pub PlayerRef, pub BoardRef);
impl Registerable for PlayerWithPos {
fn register(engine: &mut Engine, _error_sink: ErrorSink) {
fn register(engine: &mut Engine, _log_sink: LogSink) {
engine.register_type_with_name::<PlayerWithPos>("Player")
.register_get("gems", |player: &mut PlayerWithPos| player.0.borrow().gems)
.register_get("health", |player: &mut PlayerWithPos| player.0.borrow().health)