Skip to content

Commit

Permalink
fix!: image sprite property should just be string (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
kade-robertson authored Jan 23, 2023
1 parent 6479c47 commit 141527e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 51 deletions.
18 changes: 1 addition & 17 deletions src/models/champions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct ChampionData {
pub title: String,
pub blurb: String,
pub info: Info,
pub image: Image<ChampionSprite>,
pub image: Image,
pub tags: Vec<Tag>,
pub partype: String,
pub stats: HashMap<String, f64>,
Expand All @@ -33,22 +33,6 @@ pub struct Info {
pub difficulty: i64,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum ChampionSprite {
#[serde(rename = "champion0.png")]
Champion0,
#[serde(rename = "champion1.png")]
Champion1,
#[serde(rename = "champion2.png")]
Champion2,
#[serde(rename = "champion3.png")]
Champion3,
#[serde(rename = "champion4.png")]
Champion4,
#[serde(rename = "champion5.png")]
Champion5,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum Tag {
Assassin,
Expand Down
12 changes: 1 addition & 11 deletions src/models/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct Item {
pub colloq: String,
pub plaintext: String,
pub into: Option<Vec<String>>,
pub image: Image<ItemSprite>,
pub image: Image,
pub gold: Gold,
pub tags: Vec<String>,
pub maps: HashMap<String, bool>,
Expand Down Expand Up @@ -102,13 +102,3 @@ pub struct Tree {
pub header: String,
pub tags: Vec<String>,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum ItemSprite {
#[serde(rename = "item0.png")]
Item0,
#[serde(rename = "item1.png")]
Item1,
#[serde(rename = "item2.png")]
Item2,
}
2 changes: 1 addition & 1 deletion src/models/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ pub struct Map {
pub map_name: String,
#[serde(rename = "MapId")]
pub map_id: String,
pub image: Image<String>,
pub image: Image,
}
8 changes: 1 addition & 7 deletions src/models/mission_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,5 @@ pub struct MissionAssets {
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct MissionAsset {
pub id: i64,
pub image: Image<Sprite>,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum Sprite {
#[serde(rename = "mission0.png")]
Mission0,
pub image: Image,
}
4 changes: 2 additions & 2 deletions src/models/shared.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Image<T: Clone> {
pub struct Image {
pub full: String,
pub sprite: T,
pub sprite: String,
pub group: String,
pub x: i64,
pub y: i64,
Expand Down
14 changes: 1 addition & 13 deletions src/models/summoner_spells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct SummonerSpell {
pub range: Vec<i64>,
#[serde(rename = "rangeBurn")]
pub range_burn: String,
pub image: Image<SummonerSpellSprite>,
pub image: Image,
pub resource: CostType,
}

Expand All @@ -46,15 +46,3 @@ pub enum CostType {
#[serde(rename = "No Cost")]
NoCost,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum Group {
#[serde(rename = "spell")]
Spell,
}

#[derive(Serialize, Deserialize, Clone, Copy, Debug)]
pub enum SummonerSpellSprite {
#[serde(rename = "spell0.png")]
Spell0Png,
}

0 comments on commit 141527e

Please sign in to comment.