transition
This commit is contained in:
@@ -128,6 +128,15 @@ impl GameState {
|
||||
&self.current_board_name
|
||||
}
|
||||
|
||||
/// Returns a clone of the `Rc` for the active board.
|
||||
///
|
||||
/// Lets a front-end hold a reference to the current board across a board
|
||||
/// transition — the old board stays alive in `world.boards`, so the clone
|
||||
/// keeps it reachable even after `current_board_name` changes.
|
||||
pub fn board_rc(&self) -> std::rc::Rc<std::cell::RefCell<Board>> {
|
||||
self.world.boards[&self.current_board_name].clone()
|
||||
}
|
||||
|
||||
/// Appends a styled message to the log.
|
||||
pub fn log(&mut self, line: LogLine) {
|
||||
self.log.push(line);
|
||||
|
||||
Reference in New Issue
Block a user