animation play state

This commit is contained in:
Frank DeMarco 2013-12-09 11:52:19 +09:00
parent 703dbd906d
commit 7ad159094a
1 changed files with 6 additions and 3 deletions

View File

@ -48,11 +48,14 @@ class Animation(GameChild):
if self.accounts.has_key(method):
self.accounts[method].halt()
def is_playing(self, method=None, check_all=False):
def is_playing(self, method=None, check_all=False, include_delay=True):
if check_all:
return any(account.playing for method, account in
return any(self.is_account_playing(account) for method, account in
self.accounts.iteritems())
return self.accounts[self.get_default(method)].playing
return self.is_account_playing(self.accounts[self.get_default(method)])
def is_account_playing(self, account):
return account.playing and not account.delay
def update(self):
for method, account in self.accounts.iteritems():