pub struct Engine {
pub rooms: BTreeMap<RoomId, Room>,
/* private fields */
}Expand description
The core MUD engine — holds all state
Fields§
§rooms: BTreeMap<RoomId, Room>Implementations§
Source§impl Engine
impl Engine
pub fn new() -> Self
pub fn add_room(&mut self, room: Room) -> Result<(), String>
pub fn remove_room(&mut self, id: &RoomId) -> Result<Room, String>
pub fn get_room(&self, id: &RoomId) -> Option<&Room>
pub fn get_room_mut(&mut self, id: &RoomId) -> Option<&mut Room>
pub fn rooms_by_domain(&self, domain: &Domain) -> Vec<&Room>
pub fn rooms_by_depth(&self, depth: &Depth) -> Vec<&Room>
pub fn all_rooms(&self) -> Vec<&Room>
pub fn add_tile(&mut self, tile: Tile) -> Result<(), String>
pub fn get_tile(&self, id: &TileId) -> Option<&Tile>
pub fn get_tile_mut(&mut self, id: &TileId) -> Option<&mut Tile>
pub fn remove_tile(&mut self, id: &TileId) -> Result<Tile, String>
pub fn tiles_by_domain(&self, domain: &Domain) -> Vec<&Tile>
pub fn tile_dependencies(&self, id: &TileId) -> Vec<&Tile>
pub fn add_npc(&mut self, npc: Npc) -> Result<(), String>
pub fn get_npc(&self, id: &NpcId) -> Option<&Npc>
pub fn get_npc_mut(&mut self, id: &NpcId) -> Option<&mut Npc>
pub fn npcs_in_room(&self, room: &RoomId) -> Vec<&Npc>
pub fn connect_agent( &mut self, agent_id: AgentId, start_room: RoomId, ) -> Result<(), String>
pub fn disconnect_agent(&mut self, id: &AgentId) -> Result<AgentSession, String>
pub fn get_session(&self, id: &AgentId) -> Option<&AgentSession>
pub fn get_session_mut(&mut self, id: &AgentId) -> Option<&mut AgentSession>
pub fn pick_up_tile( &mut self, agent: &AgentId, tile_id: &TileId, ) -> Result<(), String>
pub fn drop_tile( &mut self, agent: &AgentId, tile_id: &TileId, ) -> Result<(), String>
pub fn craft( &mut self, agent: &AgentId, input_ids: &[TileId], recipe_name: &str, ) -> Result<Tile, String>
pub fn talk_to_npc( &mut self, _agent: &AgentId, npc_id: &NpcId, query: &str, ) -> Result<String, String>
pub fn look(&self, agent: &AgentId) -> Result<String, String>
pub fn map(&self, agent: &AgentId) -> Result<String, String>
pub fn zeitgeist(&self) -> &Zeitgeist
pub fn zeitgeist_mut(&mut self) -> &mut Zeitgeist
pub fn execute( &mut self, agent: &AgentId, cmd: Command, ) -> Result<String, String>
Sourcepub fn receive_flux(&mut self, flux: &FluxTransference) -> Result<(), String>
pub fn receive_flux(&mut self, flux: &FluxTransference) -> Result<(), String>
Process an incoming FLUX transference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Engine
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
impl UnwindSafe for Engine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more