forked from richardlord/Ash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignal3.as
38 lines (35 loc) · 834 Bytes
/
Signal3.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* Based on ideas used in Robert Penner's AS3-signals - https://github.com/robertpenner/as3-signals
*/
package ash.signals
{
/**
* Provides a fast signal for use where three parameters are dispatched with the signal.
*/
public class Signal3 extends SignalBase
{
private var type1 : Class;
private var type2 : Class;
private var type3 : Class;
public function Signal3( type1 : Class, type2 : Class, type3 : Class )
{
this.type1 = type1;
this.type2 = type2;
this.type3 = type3;
}
public function dispatch( object1 : *, object2 : *, object3 : * ) : void
{
startDispatch();
var node : ListenerNode;
for ( node = head; node; node = node.next )
{
node.listener( object1, object2, object3 );
if( node.once )
{
remove( node.listener );
}
}
endDispatch();
}
}
}