Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reload_animations(self):
self.update_time()
self.animation_map = dict()
self.animation_queue = list()
for gid, frame_data in self.data.get_animations():
frames = list()
for frame_gid, frame_duration in frame_data:
image = self.data.get_tile_image_by_gid(frame_gid)
frames.append(AnimationFrame(image, frame_duration))
ani = AnimationToken(gid, frames)
ani.next += self.last_time
self.animation_map[ani.gid] = ani.frames[ani.index].image
heappush(self.animation_queue, ani)