2
* This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
3
* For full copyright and license information please refer to doc/license.txt.
9
//NEASH: animations completely unsupported for now
10
typedef Dictionary = Dynamic;
12
import flash.utils.Dictionary;
16
* A common/shared implementation of a the core parts of an
19
* TODO: Technically only the AnimationManager needs to use the
20
* dictionary class to hold the items, since in all other cases the
21
* AnimationMaster's will actually be cleaned up and thus could use
22
* a lighter class -- check performance of this first.
26
var listeners : Dictionary;
27
var toRemove : Array<Animation>;
33
//listeners = new Array<AMCallback>();
35
listeners = new Dictionary( true ); //use weak references
38
toRemove = new Array<Animation>();
41
public function step( elapsed : Float )
45
var q : Iterator<Dynamic> = untyped (__keys__(listeners)).iterator();
51
var x : Dynamic = untyped i;
52
var anim : Animation = untyped listeners[x];
53
//var anim : Animation = i;
57
var rem : Bool = anim.animate( elapsed );
59
removeListener( anim );
67
public function addListener( anim : Animation, ?timeout : Null<Float> ) : Void
69
//TODO: timeout complete ignored now...
70
untyped listeners[anim] = anim;
73
public function removeListener( anim : Animation ) : Void
75
toRemove.push( anim );
80
/*private*/ function __cleanup()
82
if( toRemove.length == 0 )
87
var anim = toRemove.shift();
90
untyped __delete__(listeners,anim);
94
public function traceItems()
96
var q : Iterator<Dynamic> = untyped (__keys__(listeners)).iterator();