From c4158e2b6666a7cb3dbb32f50d909a44c7b2cc42 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Fri, 24 Apr 2020 18:10:10 +0100 Subject: [PATCH] infer room format --- src/game.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game.rs b/src/game.rs index 8020442..8464857 100644 --- a/src/game.rs +++ b/src/game.rs @@ -386,6 +386,11 @@ impl Game { pub fn version(&self) -> Version { self.version.unwrap_or(Version { major: 1, minor: 0 }) } + + /// older bitsy games do not specify a room format, but we can infer 0 + pub fn room_format(&self) -> RoomFormat { + self.room_format.unwrap_or(RoomFormat::Contiguous) + } } #[cfg(test)]