package com.joelhooks.pipingthemachine.shell.controller.state
{
import com.joelhooks.pipingthemachine.shell.ShellFacade;
import com.joelhooks.pipingthemachine.shell.view.ShellMediator;
import org.puremvc.as3.multicore.interfaces.ICommand;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
import org.puremvc.as3.multicore.utilities.statemachine.StateMachine;
public class StartShellCommand extends SimpleCommand implements ICommand
{
override public function execute(notification:INotification):void
{
trace("starting");
try
{
var shell:PipingTheMachine = notification.getBody() as PipingTheMachine;
facade.registerMediator( new ShellMediator(shell) );
sendNotification( StateMachine.ACTION, null, ShellFacade.STARTED );
}
catch(e:Error)
{
sendNotification( StateMachine.ACTION, e.message, ShellFacade.STARTUP_FAILED);
}
}
}
}