Reputation: 1
Heyooo I want to incorporate a commandlist into robotlegs, the way i've done it now is to have a commandlist actor funnel out all the commands when not busy, but when the commands are executed robotlegs loses its' reference to the 'contextView'. Meaning i'm doing somehting wrong.
Has anyone any useful tips on CommandLists and Robotlegs? Because i assume it's been done countless times before.
Upvotes: 0
Views: 409
Reputation: 963
How are you executing these commands?
Perhaps you were instantiating and executing them manually?
You should be using the commandMap to instantiate and execute them - this will ensure that their dependencies (like contextView etc) are supplied. For example:
commandMap.execute(SomeCommandClass);
Or (if your commands rely on events):
commandMap.execute(SomeCommandClass, someEventInstance, SomeEventClass);
If you need access to the commandMap in your utility, you might need to inject it:
[Inject] public var commandMap:ICommandMap;
Hope that helps.
Upvotes: 0
Reputation: 31
You should be interested in that utility for RobotLegs.
CommandLib (SequenceCommand)
Upvotes: 0
Reputation: 6961
This sounds like you're trying to run a bunch of Commands one after another in response to a single event. My understanding is that you should either have each Command generate an Event that triggers the next Command or simply register all the Commands to the same Event.
You shouldn't ever be touching the value of contextView (to write), so it sounds like you're doing something you shouldn't.
Upvotes: 2