Mercurial > touhou
diff pytouhou/game/sprite.py @ 21:bf225780973f
Small refactoring, and Rumia \o/
| author | Thibaut Girka <thib@sitedethib.com> |
|---|---|
| date | Thu, 11 Aug 2011 12:39:12 +0200 |
| parents | d940d004b840 |
| children | f17122405121 |
line wrap: on
line diff
--- a/pytouhou/game/sprite.py +++ b/pytouhou/game/sprite.py @@ -2,6 +2,18 @@ from pytouhou.utils.matrix import Matrix + +class AnmWrapper(object): + def __init__(self, anm_files): + self.anm_files = list(anm_files) + + def get_sprite(self, script_index): + for anm in self.anm_files: + if script_index in anm.scripts: + return anm, Sprite(anm, script_index) + + + class Sprite(object): def __init__(self, anm, script_index): self.anm = anm
