#pragma once
#include "GroupTacticalAction.h"

#include "../../../../PerceptualState/Locations/Location.h" 

class Defend : public virtual GroupTacticalAction
{
public:
  Defend(const Process* parent, unsigned int priority, const PersistentUnitGroup* initialGroup, Location* location)
    : GroupTacticalAction(parent, priority, initialGroup)
    , TacticalAction(parent, priority)
    , Process(parent)
    , m_location(*this, location)
  {
  }

protected:
  virtual void _output(std::ostream& out) const
  {
    GroupTacticalAction::_output(out);

    out << "Defend(" << getGroup()->getName() << ", " << *m_location << ")";
  }

  const AutoPtr<Location> m_location;
};
