Implement weather and time of day system
This commit is contained in:
@@ -77,6 +77,8 @@ pub struct RoomFile {
|
||||
pub description: String,
|
||||
#[serde(default)]
|
||||
pub exits: HashMap<String, String>,
|
||||
#[serde(default)]
|
||||
pub outdoors: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
@@ -413,6 +415,7 @@ pub struct Room {
|
||||
pub exits: HashMap<String, String>,
|
||||
pub npcs: Vec<String>,
|
||||
pub objects: Vec<String>,
|
||||
pub outdoors: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -665,7 +668,7 @@ impl World {
|
||||
|
||||
load_entities_from_dir(®ion_path.join("rooms"), ®ion_name, &mut |id, content| {
|
||||
let rf: RoomFile = toml::from_str(content).map_err(|e| format!("Bad room {id}: {e}"))?;
|
||||
rooms.insert(id.clone(), Room { id: id.clone(), region: region_name.clone(), name: rf.name, description: rf.description, exits: rf.exits, npcs: Vec::new(), objects: Vec::new() });
|
||||
rooms.insert(id.clone(), Room { id: id.clone(), region: region_name.clone(), name: rf.name, description: rf.description, exits: rf.exits, npcs: Vec::new(), objects: Vec::new(), outdoors: rf.outdoors });
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user