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 and an ID name?

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 tile safely and returns the ID

adds a sprite safely and returns the ID

adds an item 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Converts the given value to a String. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.