#include "Behaviors/StateMachine.h"

$nodeclass SequenceLEDParallelBehavior : StateNode {
  $setupmachine{

    launch: StateNode =N=> {step1_fd}

    step1_fd: StateNode =N=> {r_blink_fd, l_howl_fd}
    {r_blink_fd, l_howl_fd} =C(2)=> step2_fd
    {r_blink_fd, l_howl_fd} =B(RobotInfo::GreenButOffset)=> step4_bk

    step2_fd: StateNode =N=> {y_blink_fd, m_howl_fd}
    {y_blink_fd, m_howl_fd} =C(2)=> step3_fd
    {y_blink_fd, m_howl_fd} =B(RobotInfo::GreenButOffset)=> step3_bk

    step3_fd: StateNode =N=> {g_blink_fd, h_howl_fd}
    {g_blink_fd, h_howl_fd} =C(2)=> step4_fd
    {g_blink_fd, h_howl_fd} =B(RobotInfo::GreenButOffset)=> step2_bk

    step4_fd: StateNode =N=> {b_blink_fd, t_howl_fd}
    {b_blink_fd, t_howl_fd} =C(2)=> step1_fd
    {b_blink_fd, t_howl_fd} =B(RobotInfo::GreenButOffset)=> step1_bk








    step1_bk: StateNode =N=> {r_blink_bk, l_howl_bk}
    {r_blink_bk, l_howl_bk} =C(2)=> step4_bk
    {r_blink_bk, l_howl_bk} =B(RobotInfo::GreenButOffset)=> step2_fd

    step2_bk: StateNode =N=> {y_blink_bk, m_howl_bk}
    {y_blink_bk, m_howl_bk} =C(2)=> step1_bk
    {y_blink_bk, m_howl_bk} =B(RobotInfo::GreenButOffset)=> step3_fd

    step3_bk: StateNode =N=> {g_blink_bk, h_howl_bk}
    {g_blink_bk, h_howl_bk} =C(2)=> step2_bk
    {g_blink_bk, h_howl_bk} =B(RobotInfo::GreenButOffset)=> step4_fd

    step4_bk: StateNode =N=> {b_blink_bk, t_howl_bk}
    {b_blink_bk, t_howl_bk} =C(2)=> step3_bk
    {b_blink_bk, t_howl_bk} =B(RobotInfo::GreenButOffset)=> step1_fd

    r_blink_fd: LedNode [getMC()->set(RobotInfo::RedLEDMask, 1.0)]

    y_blink_fd: LedNode [getMC()->set(RobotInfo::YellowLEDMask, 1.0)]

    g_blink_fd: LedNode [getMC()->set(RobotInfo::GreenLEDMask, 1.0)]

    b_blink_fd: LedNode [getMC()->set(RobotInfo::BlueLEDMask, 1.0)]

    l_howl_fd: SoundNode($, "barklow.wav")

    m_howl_fd: SoundNode($, "barkmed.wav")

    h_howl_fd: SoundNode($, "barkhigh.wav")

    t_howl_fd: SoundNode($, "toc.wav")

    r_blink_bk: LedNode [getMC()->set(RobotInfo::RedLEDMask, 1.0)]

    y_blink_bk: LedNode [getMC()->set(RobotInfo::YellowLEDMask, 1.0)]

    g_blink_bk: LedNode [getMC()->set(RobotInfo::GreenLEDMask, 1.0)]

    b_blink_bk: LedNode [getMC()->set(RobotInfo::BlueLEDMask, 1.0)]

    l_howl_bk: SoundNode($, "barklow.wav")

    m_howl_bk: SoundNode($, "barkmed.wav")

    h_howl_bk: SoundNode($, "barkhigh.wav")

    t_howl_bk: SoundNode($, "toc.wav")


  }

}

REGISTER_BEHAVIOR(SequenceLEDParallelBehavior);
