handle optional game version and room format; transform line endings

This commit is contained in:
Max Bradbury 2020-04-24 18:08:21 +01:00
parent ebb172df7e
commit a0d109c0b8
1 changed files with 11 additions and 8 deletions

View File

@ -295,14 +295,17 @@ impl ToString for Game {
segments.push(self.font_data.to_owned().unwrap())
}
format!(
"{}\n{}\n{}{}{}\n\n{}\n\n",
&self.name,
&self.version_line(),
&self.room_format_line(),
&self.font_line(),
&self.text_direction_line(),
segments.join("\n\n"),
transform_line_endings(
format!(
"{}{}{}{}{}\n\n{}\n\n",
&self.name,
&self.version_line(),
&self.room_format_line(),
&self.font_line(),
&self.text_direction_line(),
segments.join("\n\n"),
),
if self.line_endings_crlf {TransformMode::CRLF} else {TransformMode::LF}
)
}
}