re-export modules for better ergonomics

This commit is contained in:
Max Bradbury 2020-10-09 11:57:02 +01:00
parent 575ad442d8
commit c79d33ddf2
19 changed files with 49 additions and 50 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "bitsy-parser" name = "bitsy-parser"
version = "0.72.1" version = "0.72.2"
authors = ["Max Bradbury <max@tinybird.info>"] authors = ["Max Bradbury <max@tinybird.info>"]
edition = "2018" edition = "2018"
description = "A parser and utilities for working with Bitsy game data" description = "A parser and utilities for working with Bitsy game data"

View File

@ -1,4 +1,4 @@
use bitsy_parser::game::Game; use bitsy_parser::Game;
use std::{env, fs}; use std::{env, fs};
const SYNTAX_ERROR: &str = "No game data specified. Usage: `bitsy-dedupe input.bitsy output.bitsy`"; const SYNTAX_ERROR: &str = "No game data specified. Usage: `bitsy-dedupe input.bitsy output.bitsy`";

View File

@ -1,4 +1,4 @@
use bitsy_parser::game::Game; use bitsy_parser::Game;
use std::{env, fs}; use std::{env, fs};
const SYNTAX_ERROR: &str = "No main game specified. Usage: `bitsy-merge main.bitsy additional.bitsy output.bitsy`"; const SYNTAX_ERROR: &str = "No main game specified. Usage: `bitsy-merge main.bitsy additional.bitsy output.bitsy`";

View File

@ -1,4 +1,4 @@
use bitsy_parser::game::Game; use bitsy_parser::Game;
use std::{env, fs}; use std::{env, fs};
const SYNTAX_ERROR: &str = "Usage: `bitsy-parse input.bitsy output.bitsy`"; const SYNTAX_ERROR: &str = "Usage: `bitsy-parse input.bitsy output.bitsy`";

View File

@ -1,4 +1,4 @@
use bitsy_parser::game::Game; use bitsy_parser::Game;
use std::{env, fs}; use std::{env, fs};
const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`"; const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`";

View File

@ -32,7 +32,7 @@ impl ToString for Colour {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::colour::Colour; use crate::Colour;
#[test] #[test]
fn colour_from_string() { fn colour_from_string() {

View File

@ -38,7 +38,7 @@ impl ToString for Dialogue {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::dialogue::Dialogue; use crate::Dialogue;
#[test] #[test]
fn dialogue_from_string() { fn dialogue_from_string() {

View File

@ -31,7 +31,7 @@ impl fmt::Display for Ending {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::ending::Ending; use crate::Ending;
use std::str::FromStr; use std::str::FromStr;
#[test] #[test]

View File

@ -98,8 +98,7 @@ impl fmt::Display for Exit {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::exit::{Transition, Exit}; use crate::{Transition, Exit, Position};
use crate::position::Position;
use std::str::FromStr; use std::str::FromStr;
#[test] #[test]

View File

@ -1,9 +1,10 @@
use crate::{Dialogue, Ending, Font, Item, Palette, Room, Sprite, TextDirection, Tile, Variable, transform_line_endings, segments_from_string, new_unique_id, try_id, Instance}; use crate::{Dialogue, Ending, Font, Image, Item, Palette, Room, Sprite, TextDirection, Tile, Variable, transform_line_endings, segments_from_string, new_unique_id, try_id, Instance};
use loe::TransformMode; use loe::TransformMode;
use std::str::FromStr; use std::str::FromStr;
use std::collections::HashMap; use std::collections::HashMap;
use std::borrow::BorrowMut; use std::borrow::BorrowMut;
use crate::image::Image;
use std::fmt; use std::fmt;
use std::fmt::Display; use std::fmt::Display;
@ -857,10 +858,7 @@ impl Game {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::game::{Version, Game, NotFound}; use crate::{TextDirection, Font, Version, Game, NotFound, Tile, Image};
use crate::text::{TextDirection, Font};
use crate::tile::Tile;
use crate::image::Image;
#[test] #[test]
fn game_from_string() { fn game_from_string() {

View File

@ -77,8 +77,7 @@ impl ToString for Item {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::item::Item; use crate::{Item, mock};
use crate::mock;
#[test] #[test]
fn item_from_string() { fn item_from_string() {

View File

@ -1,6 +1,8 @@
extern crate loe; extern crate loe;
use std::fmt::Display;
use std::io::Cursor; use std::io::Cursor;
use radix_fmt::radix_36; use radix_fmt::radix_36;
use loe::{process, Config, TransformMode}; use loe::{process, Config, TransformMode};
@ -20,23 +22,22 @@ pub mod text;
pub mod tile; pub mod tile;
pub mod variable; pub mod variable;
// pub mod test_omnibus; pub mod test_omnibus;
use colour::Colour; pub use colour::Colour;
use dialogue::Dialogue; pub use dialogue::Dialogue;
use ending::Ending; pub use ending::Ending;
use exit::{Exit, Transition}; pub use exit::*;
use game::{Game, Version}; pub use game::*;
use image::Image; pub use image::Image;
use item::Item; pub use item::Item;
use palette::Palette; pub use palette::Palette;
use position::Position; pub use position::Position;
use room::Room; pub use room::Room;
use sprite::Sprite; pub use sprite::Sprite;
use std::fmt::Display; pub use text::*;
use text::{Font, TextDirection}; pub use tile::Tile;
use tile::Tile; pub use variable::Variable;
use variable::Variable;
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct Instance { pub struct Instance {

View File

@ -185,8 +185,7 @@ pub fn sprite() -> Sprite {
} }
pub mod item { pub mod item {
use crate::item::Item; use crate::{Image, Item};
use crate::image::Image;
pub fn key() -> Item { pub fn key() -> Item {
Item { Item {

View File

@ -49,8 +49,7 @@ impl ToString for Palette {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::colour::Colour; use crate::{Colour, Palette};
use crate::palette::Palette;
#[test] #[test]
fn palette_from_string() { fn palette_from_string() {

View File

@ -38,7 +38,7 @@ impl fmt::Display for Position {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::position::Position; use crate::Position;
use std::str::FromStr; use std::str::FromStr;
#[test] #[test]

View File

@ -1,6 +1,14 @@
use crate::{optional_data_line, Exit, ExitInstance, Instance, Position}; use crate::{
use crate::game::{RoomType, RoomFormat}; optional_data_line,
use crate::exit::Transition; Exit,
ExitInstance,
Instance,
Position,
RoomType,
RoomFormat,
Transition
};
use std::str::FromStr; use std::str::FromStr;
use std::collections::HashMap; use std::collections::HashMap;
@ -230,8 +238,7 @@ impl Room {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::room::Room; use crate::{Room, RoomType, RoomFormat};
use crate::game::{RoomType, RoomFormat};
#[test] #[test]
fn room_from_string() { fn room_from_string() {

View File

@ -128,8 +128,7 @@ impl ToString for Sprite {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::mock; use crate::{mock, Sprite};
use crate::sprite::Sprite;
#[test] #[test]
fn sprite_from_string() { fn sprite_from_string() {

View File

@ -132,9 +132,7 @@ impl ToString for Tile {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::tile::Tile; use crate::{Image, Tile, mock};
use crate::image::Image;
use crate::mock;
#[test] #[test]
fn tile_from_string() { fn tile_from_string() {

View File

@ -27,7 +27,7 @@ impl ToString for Variable {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::variable::Variable; use crate::Variable;
#[test] #[test]
fn variable_from_string() { fn variable_from_string() {