//-*-c++-*-
#ifndef INCLUDED_ParallelBehavior_h_
#define INCLUDED_ParallelBehavior_h_
 
#include "Behaviors/StateMachine.h"
#include "Events/EventRouter.h"

class ParallelBehavior : public StateNode {

public:
  ParallelBehavior() : StateNode("ParallelBehavior") {}
 
  virtual void setup() {
#statemachine

startnode: StateNode =N=> {lightred, barklow, nolight}

nolight: LedNode [setPriority(MotionManager::kBackgroundPriority);
	          getMC()->set(RobotInfo::FaceLEDMask,0.0);]


barklow: SoundNode($,"barklow.wav")
  =C(1)=>
     barkmed

barkmed: SoundNode($,"barkmed.wav")
  =C(1)=>
     barkhigh

barkhigh: SoundNode($,"barkhigh.wav")
  =C(1)=>
     barklow

barklowback: SoundNode($,"barklow.wav")
  =C(1)=>
     barkhighback

barkmedback: SoundNode($,"barkmed.wav")
  =C(1)=>
     barklowback

barkhighback: SoundNode($,"barkhigh.wav")
  =C(1)=>
     barkmedback

barklow =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barkhighback

barkmed =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barklowback

barkhigh =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barkmedback

barklowback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barkmed

barkmedback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barkhigh

barkhighback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> barklow

lightred: LedNode [getMC()->set(RobotInfo::RedLEDMask,1.0);]
	=T(1000)=>
		lightyellow

lightyellow: LedNode [getMC()->set(RobotInfo::YellowLEDMask,1.0);]
	=T(1000)=>
		lightgreen

lightgreen: LedNode [getMC()->set(RobotInfo::GreenLEDMask,1.0);]
	=T(1000)=>
		lightblue

lightblue: LedNode [getMC()->set(RobotInfo::BlueLEDMask,1.0);]
	=T(1000)=>
		lightred

lightredback: LedNode [getMC()->set(RobotInfo::RedLEDMask,1.0);]
	=T(1000)=>
		lightblueback

lightyellowback: LedNode [getMC()->set(RobotInfo::YellowLEDMask,1.0);]
	=T(1000)=>
		lightredback

lightgreenback: LedNode [getMC()->set(RobotInfo::GreenLEDMask,1.0);]
	=T(1000)=>
		lightyellowback

lightblueback: LedNode [getMC()->set(RobotInfo::BlueLEDMask,1.0);]
	=T(1000)=>
		lightgreenback

lightred =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightblueback

lightyellow =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightredback

lightgreen =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightyellowback

lightblue =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightgreenback

lightredback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightyellow

lightyellowback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightgreen

lightgreenback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightblue

lightblueback =E(buttonEGID, RobotInfo::GreenButOffset, activateETID)=> 
	lightred

#endstatemachine
  }       // end of setup()

};

#endif
