rust/mapgen/src/lib.rs
changeset 14128 b04dac00e8e2
parent 14127 0c5b9cfda9ab
child 14137 3119d665d3c6
equal deleted inserted replaced
14127:0c5b9cfda9ab 14128:b04dac00e8e2
   109     };
   109     };
   110 
   110 
   111     #[test]
   111     #[test]
   112     fn simple_load() {
   112     fn simple_load() {
   113         let text = r#"
   113         let text = r#"
       
   114 # comment
       
   115 
   114 templates:
   116 templates:
   115   -
   117   -
   116     width: 3072
   118     width: 3072
   117     height: 1424
   119     height: 1424
   118     can_flip: false
   120     can_flip: false
   130         - {x: 1574, y: 1112, w: 332, h: 40}
   132         - {x: 1574, y: 1112, w: 332, h: 40}
   131         - {x: 1802, y: 1238, w: 226, h: 36}
   133         - {x: 1802, y: 1238, w: 226, h: 36}
   132         - {x: 1930, y: 1424, w: 1, h: 1}
   134         - {x: 1930, y: 1424, w: 1, h: 1}
   133     fill_points:
   135     fill_points:
   134       - {x: 1023, y: 0}
   136       - {x: 1023, y: 0}
       
   137       - {x: 1023, y: 0}
   135 
   138 
   136 template_types:
   139 template_types:
   137     test: [0]
   140     test: [0]
   138 
       
   139 "#;
   141 "#;
   140 
   142 
   141         let mut generator = MapGenerator::new();
   143         let mut generator = MapGenerator::new();
   142         generator.import_yaml_templates(&text);
   144         generator.import_yaml_templates(&text);
   143 
   145