a room's endings is actually a hashmap of ending IDs, not whole endings
This commit is contained in:
parent
730e253e03
commit
753e1142c0
10
src/main.rs
10
src/main.rs
|
@ -86,12 +86,12 @@ struct Ending {
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
struct Room {
|
struct Room {
|
||||||
id: String,
|
id: String,
|
||||||
palette: String, /// id
|
palette: String, // id
|
||||||
name: Option<String>,
|
name: Option<String>,
|
||||||
tiles: Vec<String>, /// tile ids
|
tiles: Vec<String>, // tile ids
|
||||||
items: HashMap<Position, String>, /// item id
|
items: HashMap<Position, String>, // item id
|
||||||
exits: HashMap<Position, Exit>,
|
exits: HashMap<Position, Exit>,
|
||||||
endings: HashMap<Position, Ending>,
|
endings: HashMap<Position, String>, // ending id
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Eq, PartialEq)]
|
#[derive(Debug, Eq, PartialEq)]
|
||||||
|
@ -711,7 +711,7 @@ fn room_from_string(string: String) -> Room {
|
||||||
let mut palette = "0".to_string();
|
let mut palette = "0".to_string();
|
||||||
let mut items: HashMap<Position, String> = HashMap::new();
|
let mut items: HashMap<Position, String> = HashMap::new();
|
||||||
let mut exits: HashMap<Position, Exit> = 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 {
|
loop {
|
||||||
let last_line = lines.pop().unwrap();
|
let last_line = lines.pop().unwrap();
|
||||||
|
|
Loading…
Reference in New Issue