This commit is contained in:
Max Bradbury 2020-09-25 16:38:15 +01:00
parent 0763d15b0e
commit 2d3bcc4f50
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ pub struct GameHasNoAvatar;
// todo no tiles? no rooms? no palettes? turn this into an enum? // todo no tiles? no rooms? no palettes? turn this into an enum?
impl Game { impl Game {
// todo return (Result<Game, ?>, Vec<Box<dyn Error>>)?
// would be nice to *try* to parse a game, and catalogue any and all errors without crashing,
// for display purposes etc.
pub fn from(string: String) -> Result<Game, NotFound> { pub fn from(string: String) -> Result<Game, NotFound> {
let line_endings_crlf = string.contains("\r\n"); let line_endings_crlf = string.contains("\r\n");
let mut string = string; let mut string = string;