infer room format

This commit is contained in:
Max Bradbury 2020-04-24 18:10:10 +01:00
parent c9bab425a2
commit c4158e2b66
1 changed files with 5 additions and 0 deletions

View File

@ -386,6 +386,11 @@ impl Game {
pub fn version(&self) -> Version { pub fn version(&self) -> Version {
self.version.unwrap_or(Version { major: 1, minor: 0 }) 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)] #[cfg(test)]