Get rooms working

This commit is contained in:
Elnu 2023-05-01 15:00:58 -07:00
parent c4eece7ffd
commit 85cc6c2f35
9 changed files with 266 additions and 143 deletions

View file

@ -100,6 +100,11 @@ impl Client {
}
}
}
// Returns (old_room, &new_room)
pub fn switch_rooms(&mut self, new_room: Rc<RefCell<Room>>) -> (Rc<RefCell<Room>>, Rc<RefCell<Room>>) {
(std::mem::replace(&mut self.room, new_room), self.room.clone())
}
}
impl PartialEq for Client {