You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,37 @@ In the command itself - named injection only required where you have multiple ev
50
50
[Inject(name='stuffHappened')]
51
51
public var stuffHappenedEvent:SomeOtherEvent;
52
52
53
-
etc - but there's a common use case where you'd only be interested in the fact that all 3 events have fired and wouldn't need the events at all, or would only need the last one.
53
+
etc - but there's a common use case where you'd only be interested in the fact that all 3 events have fired and wouldn't need the events at all, or would only need the last one.
54
+
55
+
56
+
ICompoundCommandMap has an API with 3 functions:
57
+
58
+
function mapToEvents(commandClass:Class, oneshot:Boolean = false, requiredInOrder:Boolean = false):ICompoundCommandConfig;
59
+
60
+
function hasCompoundCommand(commandClass:Class):Boolean;
61
+
62
+
function unmapCompoundCommand(commandClass:Class):ICompoundCommandConfig;
63
+
64
+
65
+
ICompoundCommandConfig - returned when mapping / unmapping - has the API:
66
+
67
+
function addRequiredEvent(eventType:String, eventClass:Class = null, named:String = ""):ICompoundCommandConfig;
68
+
69
+
// all events set using addRequiredEvent
70
+
function get requiredEvents():Array;
71
+
72
+
// events that have not yet fired
73
+
function get remainingRequiredEvents():Array;
74
+
75
+
// whether the events are only picked up in order - ie event2 is ignored until after event1 is received
76
+
function get requiredInOrder():Boolean;
77
+
78
+
/* returns an array of the events that have arrived so far as a strong typed IEventAsPayload with 3 properties:
79
+
the event, the event class and the event name if it was mapped with a name */
80
+
function get eventsAsPayloads():Array;
81
+
82
+
function get oneshot():Boolean;
83
+
54
84
55
85
See tests/org/robotlegs/base/CompoundCommandMapTest for full usage examples.
0 commit comments