no need for scriptstate any more

This commit is contained in:
2026-07-07 23:55:27 -05:00
parent 78823fcf96
commit 23b5bf2afb
18 changed files with 146 additions and 174 deletions
+9
View File
@@ -1,3 +1,5 @@
use std::cell::RefCell;
use std::rc::Rc;
use crate::keys::Keyring;
/// The game-global player state: stats that follow the player across boards.
@@ -26,7 +28,14 @@ pub struct Player {
pub gems: i64,
}
pub type PlayerRef = Rc<RefCell<Player>>;
impl Player {
/// Create a new PlayerRef from a default player
pub fn new_ref() -> PlayerRef {
Rc::new(RefCell::from(Player::default()))
}
/// Attempt to modify the gem total by the given amount, but maintain a minimum of zero.
/// If the modification would take up below zero, leave it alone and return false.
pub fn alter_gems(&mut self, delta: i64) -> bool {