Skip to content

Commit

Permalink
add Neopet.worn_items and Neopet.closet_items
Browse files Browse the repository at this point in the history
  • Loading branch information
diceroll123 committed Jan 13, 2024
1 parent b54dc45 commit 97160a9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dti/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,18 @@ def closet_url(self) -> str:
params["objects[]"] = [item.id for item in objects]
params["closet[]"] = [item.id for item in closet]
return f"https://impress-2020.openneo.net/outfits/new?{urlencode(params, doseq=True)}"

@property
def worn_items(self) -> list[Item]:
"""List[:class:`Item`]: Returns the items that are worn on the pet."""
worn, _ = _render_items(self.items)
return worn

@property
def closet_items(self) -> list[Item]:
"""List[:class:`Item`]: Returns the items that are in the closet but not worn on the pet."""
_, closet = _render_items(self.items)
return closet

def clear_closet(self) -> None:
"""Removes items from the closet that would not be rendered to the pet appearance."""
Expand Down

0 comments on commit 97160a9

Please sign in to comment.