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

class FlashesNoisesBehavior : public StateNode {

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

startnode: StateNode =N=> {flashRedF, barkLowF}

flashRedB =C=> flashBlueB 
flashRedB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashYellowF
flashRedB: LedNode [getMC()->flash(RobotInfo::RedLEDMask, 1000);]

flashYellowB =C=> flashRedB 
flashYellowB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashGreenF
flashYellowB: LedNode [getMC()->flash(RobotInfo::YellowLEDMask, 1000);]

flashGreenB =C=> flashYellowB 
flashGreenB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashBlueF
flashGreenB: LedNode [getMC()->flash(RobotInfo::GreenLEDMask, 1000);]

flashBlueB =C=> flashGreenB
flashBlueB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashRedF
flashBlueB: LedNode [getMC()->flash(RobotInfo::BlueLEDMask, 1000);]


flashRedF =C=> flashYellowF 
flashRedF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashBlueB
flashRedF: LedNode [getMC()->flash(RobotInfo::RedLEDMask, 1000);]

flashYellowF =C=> flashGreenF 
flashYellowF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashRedB
flashYellowF: LedNode [getMC()->flash(RobotInfo::YellowLEDMask, 1000);]

flashGreenF =C=> flashBlueF 
flashGreenF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashYellowB
flashGreenF: LedNode [getMC()->flash(RobotInfo::GreenLEDMask, 1000);]

flashBlueF =C=> flashRedF
flashBlueF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=>flashGreenB
flashBlueF: LedNode [getMC()->flash(RobotInfo::BlueLEDMask, 1000);]

barkLowF =C=> barkMedF
barkLowF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkHighB
barkLowF: SoundNode($, "barklow.wav")

barkMedF =C=> barkHighF
barkMedF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkLowB
barkMedF: SoundNode($, "barkmed.wav")

barkHighF =C=> barkLowF
barkHighF =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkMedB
barkHighF: SoundNode($, "barkhigh.wav")

barkLowB =C=> barkHighB
barkLowB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkMedF
barkLowB: SoundNode($, "barklow.wav")

barkMedB =C=> barkLowB
barkMedB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkHighF
barkMedB: SoundNode($, "barkmed.wav")

barkHighB =C=> barkMedB
barkHighB =E(buttonEGID, ChiaraInfo::GreenButOffset, activateETID)=> barkLowF
barkHighB: SoundNode($, "barkhigh.wav")

#endstatemachine
  }       // end of setup()

};

#endif
