[−][src]Struct bitsy_parser::game::Game
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
impl Game[src]
pub fn from(string: String) -> Result<Game, NotFound>[src]
pub fn get_sprite_by_id(&self, id: String) -> Result<&Sprite, NotFound>[src]
todo refactor this into "get T by ID", taking a Vec
pub fn get_tile_by_id(&self, id: String) -> Result<&Tile, NotFound>[src]
pub fn get_room_by_id(&self, id: String) -> Result<&Room, NotFound>[src]
pub fn get_avatar(&self) -> Result<&Sprite, NotFound>[src]
pub fn get_tiles_by_ids(&self, ids: Vec<String>) -> Vec<&Tile>[src]
pub fn get_tiles_for_room(&self, id: String) -> Result<Vec<&Tile>, NotFound>[src]
pub fn merge(&mut self, game: &Game)[src]
impl Game[src]
pub fn palette_ids(&self) -> Vec<String>[src]
pub fn tile_ids(&self) -> Vec<String>[src]
pub fn sprite_ids(&self) -> Vec<String>[src]
pub fn room_ids(&self) -> Vec<String>[src]
pub fn item_ids(&self) -> Vec<String>[src]
pub fn dialogue_ids(&self) -> Vec<String>[src]
pub fn ending_ids(&self) -> Vec<String>[src]
pub fn variable_ids(&self) -> Vec<String>[src]
pub fn new_palette_id(&self) -> String[src]
pub fn new_tile_id(&self) -> String[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 new_sprite_id(&self) -> String[src]
pub fn new_room_id(&self) -> String[src]
pub fn new_item_id(&self) -> String[src]
pub fn new_dialogue_id(&self) -> String[src]
pub fn new_ending_id(&self) -> String[src]
pub fn new_variable_id(&self) -> String[src]
pub fn get_tile_id(&self, matching_tile: &Tile) -> Option<String>[src]
todo refactor?
pub fn find_tile_with_animation(&self, animation: &Vec<Image>) -> Option<&Tile>[src]
pub fn add_palette(&mut self, palette: Palette) -> String[src]
adds a palette safely and returns the ID
pub fn add_tile(&mut self, tile: Tile) -> String[src]
adds a tile safely and returns the ID
pub fn add_sprite(&mut self, sprite: Sprite) -> String[src]
adds a sprite safely and returns the ID
pub fn add_item(&mut self, item: Item) -> String[src]
adds an item safely and returns the ID
pub fn add_dialogue(&mut self, dialogue: Dialogue) -> String[src]
adds a dialogue safely and returns the ID
pub fn add_ending(&mut self, ending: Ending) -> String[src]
adds an ending safely and returns the ID
pub fn add_room(&mut self, room: Room) -> String[src]
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.
pub fn add_variable(&mut self, variable: Variable) -> String[src]
pub fn dedupe_tiles(&mut self)[src]
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,