parent
4f0b3e2d65
commit
73b2f1421f
@ -1,29 +1,29 @@
|
||||
#[derive(Debug)]
|
||||
pub struct Exit {
|
||||
/// vnum
|
||||
pub vnum: i64,
|
||||
/// vnum
|
||||
pub vnum: i64,
|
||||
|
||||
/// exit name
|
||||
pub name: String,
|
||||
/// exit name
|
||||
pub name: String,
|
||||
|
||||
/// command to use the exit
|
||||
pub cmd: String,
|
||||
/// command to use the exit
|
||||
pub cmd: String,
|
||||
|
||||
/// exit direction
|
||||
pub dir: i8,
|
||||
/// exit direction
|
||||
pub dir: i8,
|
||||
|
||||
/// exit flags
|
||||
pub flags: i64,
|
||||
/// exit flags
|
||||
pub flags: i64,
|
||||
|
||||
/// extra data
|
||||
pub data: String,
|
||||
/// extra data
|
||||
pub data: String,
|
||||
|
||||
/// movement cost?
|
||||
pub weight: f64,
|
||||
/// movement cost?
|
||||
pub weight: f64,
|
||||
|
||||
/// exit color
|
||||
pub color: String,
|
||||
/// exit color
|
||||
pub color: String,
|
||||
|
||||
/// decay?
|
||||
pub decay: f64,
|
||||
/// decay?
|
||||
pub decay: f64,
|
||||
}
|
||||
|
@ -1,43 +1,66 @@
|
||||
use std::fmt;
|
||||
|
||||
use crate::tintin;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Room {
|
||||
/// room number
|
||||
pub vnum: i64,
|
||||
/// room number
|
||||
pub vnum: i64,
|
||||
|
||||
/// flags
|
||||
pub flags: i64,
|
||||
|
||||
/// flags
|
||||
pub flags: i64,
|
||||
/// color
|
||||
pub color: String,
|
||||
|
||||
/// color
|
||||
pub color: String,
|
||||
/// room name
|
||||
pub name: String,
|
||||
|
||||
/// room name
|
||||
pub name: String,
|
||||
/// room symbol
|
||||
pub symbol: String,
|
||||
|
||||
/// room symbol
|
||||
pub symbol: String,
|
||||
/// room description
|
||||
pub desc: String,
|
||||
|
||||
/// room description
|
||||
pub desc: String,
|
||||
/// area that room is in
|
||||
pub area: String,
|
||||
|
||||
/// area that room is in
|
||||
pub area: String,
|
||||
/// notes
|
||||
pub note: String,
|
||||
|
||||
/// notes
|
||||
pub note: String,
|
||||
/// type of terrain
|
||||
pub terrain: String,
|
||||
|
||||
/// type of terrain
|
||||
pub terrain: String,
|
||||
/// extra data
|
||||
pub data: String,
|
||||
|
||||
/// extra data
|
||||
pub data: String,
|
||||
/// movement cost
|
||||
pub weight: f64,
|
||||
|
||||
/// movement cost
|
||||
pub weight: f64,
|
||||
/// room id
|
||||
pub id: String,
|
||||
|
||||
/// room id
|
||||
pub id: String,
|
||||
/// exits
|
||||
pub exits: Vec<tintin::Exit>,
|
||||
}
|
||||
|
||||
/// 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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue