handle room tiles
This commit is contained in:
parent
6e9b91d845
commit
9830d57d13
20
src/main.rs
20
src/main.rs
|
@ -747,15 +747,19 @@ fn room_from_string(string: String) -> Room {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Room {
|
let lines = lines;
|
||||||
id,
|
|
||||||
palette,
|
let mut tiles : Vec<String> = Vec::new();
|
||||||
name,
|
|
||||||
tiles: vec![],
|
for line in lines.into_iter() {
|
||||||
items,
|
let line: Vec<&str> = line.split(",").collect();
|
||||||
exits,
|
|
||||||
endings
|
for tile_id in line {
|
||||||
|
tiles.push(tile_id.to_string());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Room { id, palette, name, tiles, items, exits, endings }
|
||||||
}
|
}
|
||||||
|
|
||||||
// fn game_from_string(game: String ) -> Game {
|
// fn game_from_string(game: String ) -> Game {
|
||||||
|
|
Loading…
Reference in New Issue