handle room tiles
This commit is contained in:
parent
6e9b91d845
commit
9830d57d13
20
src/main.rs
20
src/main.rs
|
@ -747,17 +747,21 @@ fn room_from_string(string: String) -> Room {
|
|||
}
|
||||
}
|
||||
|
||||
Room {
|
||||
id,
|
||||
palette,
|
||||
name,
|
||||
tiles: vec![],
|
||||
items,
|
||||
exits,
|
||||
endings
|
||||
let lines = lines;
|
||||
|
||||
let mut tiles : Vec<String> = Vec::new();
|
||||
|
||||
for line in lines.into_iter() {
|
||||
let line: Vec<&str> = line.split(",").collect();
|
||||
|
||||
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 {
|
||||
// // probably needs to split the game data into different segments starting from the end
|
||||
// // e.g. VAR... then END... then DLG...
|
||||
|
|
Loading…
Reference in New Issue