[][src]Struct bitsy_parser::game::Game

pub struct Game {
    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 avatar: Sprite,
    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>avatar: Spritesprites: Vec<Sprite>items: Vec<Item>dialogues: Vec<Dialogue>endings: Vec<Ending>variables: Vec<Variable>font_data: Option<String>

Implementations

impl Game[src]

pub fn from(string: String) -> Result<Game, &'static dyn Error>[src]

impl Game[src]

pub fn tile_ids(&self) -> Vec<u64>[src]

pub fn new_tile_id(&self) -> u64[src]

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

pub fn add_tile(&mut self, tile: Tile) -> u64[src]

adds a tile safely and returns the new tile ID

pub fn version(&self) -> Version[src]

older bitsy games do not specify a version, but we can infer 1.0

pub fn room_format(&self) -> RoomFormat[src]

older bitsy games do not specify a room format, but we can infer 0

Trait Implementations

impl Clone for Game[src]

impl Debug for Game[src]

impl PartialEq<Game> for Game[src]

impl StructuralPartialEq for Game[src]

impl ToString for Game[src]

Auto Trait Implementations

impl RefUnwindSafe for Game

impl Send for Game

impl Sync for Game

impl Unpin for Game

impl UnwindSafe for Game

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.