Remove serde dependency

This commit is contained in:
Stephen Seo 2023-02-23 18:08:41 +09:00
parent b647364e2e
commit e3f74d3f3e
4 changed files with 13 additions and 37 deletions

21
Cargo.lock generated
View file

@ -97,7 +97,6 @@ version = "0.1.1"
dependencies = [
"bindgen",
"rand",
"serde",
]
[[package]]
@ -245,26 +244,6 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "serde"
version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.152"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "shlex"
version = "1.1.0"

View file

@ -9,7 +9,7 @@ edition = "2021"
[dependencies]
#quicksilver = { version = "0.3.19", default-features = false, features = [ "fonts", "saving", "sounds" ] }
rand = "0.7.2"
serde = { version = "1.0.101", features = ["derive"] }
#serde = { version = "1.0.101", features = ["derive"] }
[build-dependencies]
bindgen = "0.64"

View file

@ -2,13 +2,11 @@ use std::collections::HashMap;
use std::ops::{Add, AddAssign, Mul, Sub, SubAssign};
use std::path::Path;
use serde::{Deserialize, Serialize};
use crate::agnostic_interface::{
FontInterface, GameInterface, ImageInterface, MusicInterface, SoundInterface,
};
#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Color {
pub r: u8,
pub g: u8,
@ -43,7 +41,7 @@ impl Color {
}
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Rectangle {
pub x: f32,
pub y: f32,
@ -73,7 +71,7 @@ impl Default for Rectangle {
}
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Circle {
pub x: f32,
pub y: f32,
@ -91,7 +89,7 @@ impl Circle {
}
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Vector {
pub x: f32,
pub y: f32,
@ -156,7 +154,7 @@ impl From<(f32, f32)> for Vector {
}
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Transform {
pub mat: [f32; 9],
}

View file

@ -3,7 +3,6 @@ use std::{path::PathBuf, str::FromStr};
use crate::agnostic_interface::CameraInterface;
use crate::faux_quicksilver::{Circle, Color, Rectangle, Transform, Vector, Window};
use rand::prelude::*;
use serde::{Deserialize, Serialize};
const WIDTH_F: f32 = 800.0;
const HEIGHT_F: f32 = 600.0;
@ -523,7 +522,7 @@ impl Menu {
}
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Clone)]
struct Particle {
rect: Rectangle,
circle: Circle,
@ -536,7 +535,7 @@ struct Particle {
life_timer: f32,
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Clone)]
struct ParticleSystem {
particles: Vec<Particle>,
spawn_timer: f32,
@ -687,7 +686,7 @@ impl ParticleSystem {
}
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Clone)]
struct RotatingParticleSystem {
particle_system: ParticleSystem,
r: f32,
@ -885,7 +884,7 @@ impl ExplConvParticleSystem {
}
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Clone)]
struct Planet {
circle: Circle,
color: Color,
@ -971,7 +970,7 @@ impl Planet {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
struct Star {
color: Color,
particle_system: ParticleSystem,
@ -1039,7 +1038,7 @@ impl Star {
}
}
#[derive(Clone, Serialize, Deserialize)]
#[derive(Clone)]
struct Fish {
pos: Vector,
r: f32,
@ -1172,7 +1171,7 @@ impl Fish {
}
}
#[derive(Serialize, Deserialize, Clone)]
#[derive(Clone)]
struct SaveData {
planets: Vec<Planet>,
stars: Vec<Star>,