From 24357a95f80d3038eec36ee83cc25ba5b57e289a Mon Sep 17 00:00:00 2001 From: rasul Date: Sun, 5 Apr 2020 16:14:00 -0500 Subject: [PATCH] add some doc comments --- src/world/room.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/world/room.rs b/src/world/room.rs index 99b620a..e17cb63 100644 --- a/src/world/room.rs +++ b/src/world/room.rs @@ -9,17 +9,30 @@ use crate::id::Id; use crate::try_log; use crate::world::{Area, AreaType, Direction, Exit, DIRECTION_LIST}; +/// A specific location in the world. #[derive(Debug, Deserialize, Serialize)] pub struct Room { + /// Unique identifier pub id: Id, + + /// Parent zone that the room is in pub zone: Id, + + /// Name of the room pub name: String, + + /// Description, each line an entry in a `Vec` pub description: Vec, + + /// Whether users in the room should be visible to the parent zone pub users_visible: bool, + + /// Exits from the room pub exits: HashMap, } impl Room { + /// Return a list of available exits by the short identifier pub fn exit_string(&self) -> String { if self.exits.is_empty() { return String::new();