#pragma once
#include "../../../../Utils/Process/FSM/FSMState.h"

/**
 * @brief A behavior state represents a state in a finite state machine. Each state stores code to execute
 *        when it becomes active, and transitions associated to events to get out of that state.
 */
typedef FSMState BehaviorState;

/**
 * @brief A behavior state represents a state in a finite state machine. Each state stores code to execute
 *        when it becomes active, and transitions associated to events to get out of that state.  
 * @tparam DerivedState The most derived class of this behavior state. Used to allow static polymorphism.
 */
template <class Behavior, class DerivedState>
class BehaviorStateT : public FSMStateT<Behavior, DerivedState>
{
public:
  /**
   * @brief Constructs a new behavior state.
   * @param behavior The enclosing behavior, which stores information common to all states.
   */
  BehaviorStateT(Behavior& behavior)
    : FSMStateT(behavior)
  {
  }

  /**
   * @return The behavior encapsulating this state, which stores information common to all states.
   */
  const Behavior& getBehavior() const
  {
    return m_context;
  }
private:
  BehaviorStateT(const BehaviorStateT& other);
};
