Struct bitsy_parser::game::Game [−][src]
pub struct Game {Show fields
pub name: String,
pub version: Option<Version>,
pub room_format: Option<RoomFormat>,
pub font: Font,
pub custom_font: Option<String>,
pub text_direction: TextDirection,
pub palettes: Vec<Palette>,
pub rooms: Vec<Room>,
pub tiles: Vec<Tile>,
pub sprites: Vec<Sprite>,
pub items: Vec<Item>,
pub dialogues: Vec<Dialogue>,
pub endings: Vec<Ending>,
pub variables: Vec<Variable>,
pub font_data: Option<String>,
// some fields omitted
}Fields
name: Stringversion: Option<Version>room_format: Option<RoomFormat>font: Fontcustom_font: Option<String>text_direction: TextDirectionpalettes: Vec<Palette>rooms: Vec<Room>tiles: Vec<Tile>sprites: Vec<Sprite>items: Vec<Item>dialogues: Vec<Dialogue>endings: Vec<Ending>variables: Vec<Variable>font_data: Option<String>Implementations
todo refactor this into “get T by ID”, taking a Vec
first available tile ID.
e.g. if current tile IDs are [0, 2, 3] the result will be 1
if current tile IDs are [0, 1, 2] the result will be 3
todo refactor?
adds a palette safely and returns the ID
adds a sprite safely and returns the ID
adds a dialogue safely and returns the ID
adds an ending safely and returns the ID
Safely adds a room and returns the room ID (a new ID will be generated if clashing) You will need to be mindful that the room’s palette, tile, exit and ending IDs will be valid after adding.
todo I think I need a generic dedupe(&mut self, Vec<T>) function
it would have to take a closure for comparing a given T (see the background_tile below)
and a closure for what to do with the changed IDs
older bitsy games do not specify a version, but we can infer 1.0
older bitsy games do not specify a room format, but we can infer 0
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Gameimpl UnwindSafe for GameBlanket Implementations
Mutably borrows from an owned value. Read more