@ -104,7 +104,7 @@ fn main() -> Result<(), Box<dyn Error>> {
}
for (vnum, room) in tintin_rooms {
println!("R {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}}", vnum, room.flags, room.color, room.name, room.symbol, room.desc, room.area, room.note, room.terrain, room.data, room.weight, room.id);
println!("{}", room);
for exit in room.exits {
println!(
@ -1,3 +1,5 @@
use std::fmt;
use crate::tintin;
#[derive(Debug)]
@ -41,3 +43,24 @@ pub struct Room {
/// exits
pub exits: Vec<tintin::Exit>,
impl fmt::Display for Room {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"R {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}} {{{}}}",
&self.vnum,
&self.flags,
&self.color,
&self.name,
&self.symbol,
&self.desc,
&self.area,
&self.note,
&self.terrain,
&self.data,
&self.weight,
&self.id
)