implement Clone
This commit is contained in:
parent
ea09d06b35
commit
4ed5ed3d65
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "bitsy-parser"
|
||||
version = "0.70.0"
|
||||
version = "0.70.1"
|
||||
authors = ["Max Bradbury <max@tinybird.info>"]
|
||||
edition = "2018"
|
||||
description = "A parser for Bitsy game data"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Colour {
|
||||
pub red: u8,
|
||||
pub green: u8,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use crate::optional_data_line;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Dialogue {
|
||||
pub id: String,
|
||||
pub contents: String,
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::error::Error;
|
|||
use std::str::FromStr;
|
||||
|
||||
// same as a dialogue basically
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Ending {
|
||||
id: String,
|
||||
dialogue: String,
|
||||
|
|
|
@ -3,7 +3,7 @@ use std::str::FromStr;
|
|||
use std::error::Error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Transition {
|
||||
None,
|
||||
FadeToWhite,
|
||||
|
@ -51,7 +51,7 @@ impl ToString for Transition {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Exit {
|
||||
/// destination
|
||||
pub room_id: u64,
|
||||
|
|
|
@ -65,7 +65,7 @@ impl Version {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct Game {
|
||||
pub name: String,
|
||||
pub version: Option<Version>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Image {
|
||||
pub pixels: Vec<u8>, // 64 for SD, 256 for HD
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{from_base36, optional_data_line, AnimationFrames, Image, ToBase36};
|
||||
use crate::image::animation_frames_from_string;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Item {
|
||||
pub id: u64,
|
||||
pub animation_frames: Vec<Image>,
|
||||
|
|
|
@ -36,13 +36,13 @@ use text::{Font, TextDirection};
|
|||
use tile::Tile;
|
||||
use variable::Variable;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Instance {
|
||||
position: Position,
|
||||
id: String, // item / ending.rs id
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct ExitInstance {
|
||||
position: Position,
|
||||
exit: Exit,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::colour::Colour;
|
||||
use crate::{from_base36, ToBase36};
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Palette {
|
||||
pub id: u64,
|
||||
pub name: Option<String>,
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::error::Error;
|
|||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Position {
|
||||
pub x: u8,
|
||||
pub y: u8,
|
||||
|
|
|
@ -3,7 +3,7 @@ use crate::game::{RoomType, RoomFormat};
|
|||
use crate::exit::Transition;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Room {
|
||||
pub id: u64,
|
||||
pub palette_id: Option<u64>, // optional in very early versions
|
||||
|
|
|
@ -2,7 +2,7 @@ use crate::{from_base36, optional_data_line, AnimationFrames, Image, Position, T
|
|||
use crate::image::animation_frames_from_string;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Sprite {
|
||||
pub id: u64,
|
||||
pub name: Option<String>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Font {
|
||||
AsciiSmall, // default - does not appear in game data
|
||||
UnicodeEuropeanSmall,
|
||||
|
@ -32,7 +32,7 @@ impl Font {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum TextDirection {
|
||||
LeftToRight, // default
|
||||
RightToLeft,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use crate::{from_base36, optional_data_line, AnimationFrames, Image, ToBase36};
|
||||
use crate::image::animation_frames_from_string;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Tile {
|
||||
pub id: u64,
|
||||
pub name: Option<String>,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#[derive(Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub struct Variable {
|
||||
pub id: String,
|
||||
pub initial_value: String,
|
||||
|
|
Loading…
Reference in New Issue