a room's endings is actually a hashmap of ending IDs, not whole endings

This commit is contained in:
Max Bradbury 2020-04-06 20:34:35 +01:00
parent 730e253e03
commit 753e1142c0
1 changed files with 5 additions and 5 deletions

View File

@ -86,12 +86,12 @@ struct Ending {
#[derive(Debug, Eq, PartialEq)]
struct Room {
id: String,
palette: String, /// id
palette: String, // id
name: Option<String>,
tiles: Vec<String>, /// tile ids
items: HashMap<Position, String>, /// item id
tiles: Vec<String>, // tile ids
items: HashMap<Position, String>, // item id
exits: HashMap<Position, Exit>,
endings: HashMap<Position, Ending>,
endings: HashMap<Position, String>, // ending id
}
#[derive(Debug, Eq, PartialEq)]
@ -711,7 +711,7 @@ fn room_from_string(string: String) -> Room {
let mut palette = "0".to_string();
let mut items: HashMap<Position, String> = HashMap::new();
let mut exits: HashMap<Position, Exit> = HashMap::new();
let endings: HashMap<Position, Ending> = HashMap::new();
let mut endings: HashMap<Position, String> = HashMap::new();
loop {
let last_line = lines.pop().unwrap();