#pragma once
#include "../../../Behaviors/GroupBehavior.h"

/**
 * @brief EngageEnemiesBehavior is the base class for behaviors commanding a group to engage enemies.
 *        This behavior can terminate with the "Retreat" mode.
 */
class EngageEnemiesBehavior : public virtual GroupBehavior
{
public:
  EngageEnemiesBehavior(const Process* parent, unsigned int initialPriority, const PersistentUnitGroup* group)
    : GroupBehavior(parent, initialPriority, group)
    , Behavior(parent, initialPriority)
    , FSM(parent)
    , Process(parent)
  {
  }

  /**
   * @brief Termination mode where the units decided to retreat.
   */
  static const TerminationMode Retreat;
};

template <class DerivedBehavior>
class EngageEnemiesBehaviorT : public virtual EngageEnemiesBehavior, public GroupBehaviorT<DerivedBehavior>
{
public:
  EngageEnemiesBehaviorT(const Process* parent, unsigned int initialPriority, const PersistentUnitGroup* group)
    : EngageEnemiesBehavior(parent, initialPriority, group)
    , GroupBehaviorT(parent, initialPriority, group)
    , GroupBehavior(parent, initialPriority, group)
    , Behavior(parent, initialPriority)
    , FSM(parent)
    , Process(parent)
  {
  }
};