debugging reference and ownership issues
This commit is contained in:
10
src/util.rs
10
src/util.rs
@@ -4,6 +4,9 @@ use std::collections::HashMap;
|
||||
use std::borrow::Cow;
|
||||
use std::str::FromStr;
|
||||
use sfml::graphics::IntRect;
|
||||
use std::fs::File;
|
||||
use std::io::BufRead;
|
||||
use std::io::BufReader;
|
||||
|
||||
pub fn read_spritesheet(filename: String) -> HashMap<String, HashMap<String, i32>> {
|
||||
|
||||
@@ -75,4 +78,11 @@ pub fn grab_sheet_rec(spritename: String, spritesheet: &HashMap<String, HashMap<
|
||||
*block_desc.get("width").unwrap(),
|
||||
*block_desc.get("height").unwrap()
|
||||
)
|
||||
}
|
||||
|
||||
pub fn read_map(filename: String) {
|
||||
let file = File::open(filename).expect("Could not open file");
|
||||
for line in BufReader::new(file).lines() {
|
||||
println!("{:?}", line);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user