diff --git a/src/main.rs b/src/main.rs index e085b40..31802cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::fmt; +use std::collections::HashMap; #[derive(Eq, PartialEq)] struct Colour { @@ -27,7 +28,7 @@ struct Tile { animation_frames: Vec, } -#[derive(Eq, PartialEq)] +#[derive(Eq, PartialEq, Hash)] struct Position { room: String, // id. is room id int or base36 string? x: u8, @@ -49,6 +50,7 @@ struct Sprite { position: Position, } +/// avatar is a "sprite" in the game data but with a specific ID #[derive(Eq, PartialEq)] struct Avatar { animation_frames: Vec, @@ -63,6 +65,29 @@ struct Item { dialogue: Option, } +#[derive(Eq, PartialEq)] +struct Exit { + /// destination + room: String, /// id + position: Position, +} + +// same as a dialogue basically +#[derive(Eq, PartialEq)] +struct Ending { + contents: String, +} + +#[derive(Eq, PartialEq)] +struct Room { + id: String, + palette: String, /// id + name: Option, + items: HashMap, + exits: HashMap, + endings: HashMap, +} + #[derive(PartialEq)] struct Game { name: String,