Skip to content

Commit

Permalink
🔀 Merge pull request #52 from Deleca7755/main
Browse files Browse the repository at this point in the history
Adds support for the "other" category In sprites
  • Loading branch information
beastmatser authored Apr 6, 2023
2 parents b587265 + 76f3a7c commit 26081ae
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/aiopoke/objects/utility/common_models/sprites.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Sprites:
generation_6: Optional["GenerationVISprites"]
generation_7: Optional["GenerationVIISprites"]
generation_8: Optional["GenerationVIIISprites"]
other: Optional["Other"]

def __init__(self, data) -> None:
self.back_default = Sprite.from_url(data["back_default"])
Expand Down Expand Up @@ -59,6 +60,8 @@ def __init__(self, data) -> None:
data["versions"]["generation-viii"]
)

self.other = Other(data["other"]) if data.get("other") is not None else None


class GenerationISprites:
red_blue_back_default: OptionalSprite
Expand Down Expand Up @@ -378,3 +381,22 @@ class GenerationVIIISprites:
def __init__(self, data) -> None:
self.icons_front_default = Sprite.from_url(data["icons"]["front_default"])
self.icons_front_female = Sprite.from_url(data["icons"]["front_female"])


class Other:
dream_world_front_default: OptionalSprite
dream_world_front_female: OptionalSprite
home_front_default: OptionalSprite
home_front_female: OptionalSprite
home_front_shiny: OptionalSprite
home_front_shiny_female: OptionalSprite

def __init__(self, data) -> None:
self.dream_world_front_default = Sprite.from_url(data["dream_world"]["front_default"])
self.dream_world_front_female = Sprite.from_url(data["dream_world"]["front_female"])
self.home_front_default = Sprite.from_url(data["home"]["front_default"])
self.home_front_female = Sprite.from_url(data["home"]["front_female"])
self.home_front_shiny = Sprite.from_url(data["home"]["front_shiny"])
self.home_front_shiny_female = Sprite.from_url(data["home"]["front_shiny_female"])
self.official_artwork_front_default = Sprite.from_url(data["official-artwork"]["front_default"])
self.official_artwork_front_shiny = Sprite.from_url(data["official-artwork"]["front_shiny"])

0 comments on commit 26081ae

Please sign in to comment.