From 07c9126ae75fe9b3a5625d895da2e298211b9861 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 21 Apr 2020 00:19:06 -0500 Subject: [PATCH] cleanup imports, improve typehints in sprites.py --- triple-dungeon/sprites.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/triple-dungeon/sprites.py b/triple-dungeon/sprites.py index 2b5f5f9..f1c216c 100644 --- a/triple-dungeon/sprites.py +++ b/triple-dungeon/sprites.py @@ -2,13 +2,13 @@ sprites.py A file dedicated to managing sprites and animations for characters. """ -from itertools import cycle import arcade import os import re -from typing import Pattern +from typing import Pattern, Iterable +from itertools import cycle class AnimationSet(object): @@ -16,7 +16,7 @@ class AnimationSet(object): A class that helps assist with grabbing new animations from a set. """ - def __init__(self, directory: str): + def __init__(self, directory: str) -> None: """ Initializes the AnimationSet class by loading files and @@ -26,7 +26,7 @@ class AnimationSet(object): self.directory = directory self.animations = os.listdir(directory) - def getAnimations(self, pattern: Pattern) -> iter: + def getAnimations(self, pattern: Pattern) -> Iterable[arcade.Texture]: """ Loads all animations from the AnimationSet's directory that match the pattern. The pattern must have 1 group that specifies the animation's index. @@ -56,7 +56,7 @@ class PlayerAnimations(AnimationSet): index: [0,) - The index of the animation. Index should be enumerated in ascending order. """ - def __init__(self, directory: str): + def __init__(self, directory: str) -> None: """ Initializes the PlayerAnimations class. """