use super::{Entity, EntityContext}; use anyhow::Result; use hurrycurry_protocol::{glam::IVec2, Menu, PacketC, PlayerID}; #[derive(Debug, Clone)] pub struct Book(pub IVec2); impl Entity for Book { fn interact( &mut self, c: EntityContext<'_>, pos: Option, _player: PlayerID, ) -> Result { if pos == Some(self.0) { c.packet_out.push_back(PacketC::Menu(Menu::Book)); return Ok(true); } Ok(false) } }