summaryrefslogtreecommitdiff
path: root/src/map.rs
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2019-06-26 05:50:34 -0500
committertom barrett <spalf0@gmail.com>2019-06-26 05:50:34 -0500
commit53b4ccdcc6cdac3b02480a97a2ec30439114ff6c (patch)
treee7925bfd55c15c68b13301301bd12a6d092e43c4 /src/map.rs
parent15b4ade5a357a791cf3ffa86cfe78b5f7ae270c9 (diff)
now can parse tile properties
Diffstat (limited to 'src/map.rs')
-rw-r--r--src/map.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/map.rs b/src/map.rs
index 38fb326..dc50116 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -17,8 +17,16 @@ impl Map {
pub fn new(file: File, tileset: &Tileset) -> Map {
let elements = XMLElements::new(file);
- let width = elements.get_element_attribute("map", "width").unwrap();
- let height = elements.get_element_attribute("map", "height").unwrap();
+ let width = elements
+ .get_element_attribute("map", "width")
+ .unwrap()
+ .parse()
+ .unwrap();
+ let height = elements
+ .get_element_attribute("map", "height")
+ .unwrap()
+ .parse()
+ .unwrap();
let layers = elements
.events