1 module prova.graphics.sprites.spriteanimation;
2 
3 import prova.graphics;
4 
5 ///
6 class SpriteAnimation
7 {
8   ///
9   string name;
10   ///
11   SpriteFrame[] frames;
12 
13   ///
14   this(string name, SpriteFrame[] frames)
15   {
16     this.name = name;
17     this.frames = frames;
18   }
19 
20   ///
21   float getDuration()
22   {
23     float duration = 0;
24 
25     foreach(SpriteFrame frame; frames)
26       duration += frame.duration;
27 
28     return duration;
29   }
30 }