#pragma once
#include "../../../Utils/Utils.h"
#include "../../SituationAnalysis/Layer3TacticalRecognition/Layer3TacticalRecognition.h"
#include "../Layer2Actions/Layer2Actions.h"
#include "Interface/ArmyComposition.h"
#include "Interface/TechSet.h"

class Layer3Tactical : public Process
{
public:
  Layer3Tactical(Layer3TacticalRecognition& layer3TacticalRecognition, Layer2Actions& layer2Actions)
    : Process(Spar)
    , m_layer3TacticalRecognition(layer3TacticalRecognition)
    , m_layer2Actions(layer2Actions)
  {
    s_instance = this;
  }

  ///////////////////////
  // Level 4 interface //
  ///////////////////////
  virtual void setTargetTechs(const TechSet& targetTechs)
  {
    m_currentTargetTechs = targetTechs;
  }

  virtual void setTargetArmyComposition(const ArmyComposition& targetArmyComposition)
  {
    m_currentTargetArmyComposition = targetArmyComposition;
  }

  /////////
  // GUI //
  /////////
  const TechSet& getTargetTechs() const
  {
    return m_currentTargetTechs;
  }

  const ArmyComposition& getTargetArmyComposition() const
  {
    return m_currentTargetArmyComposition;
  }

  typedef empty<Layer3Tactical> L3UnitData;

  static Layer3Tactical& getInstance()
  {
    return *s_instance;
  }

  void onFrame() {}
protected:
  virtual void onStart() {}
  virtual void onEnd() {}

  virtual void _output(std::ostream& out) const
  {
    out << "Layer 3 Decision making - Tactical";
  }

  static Layer3Tactical* s_instance;

  Layer3TacticalRecognition& m_layer3TacticalRecognition;
  Layer2Actions& m_layer2Actions;

  TechSet m_currentTargetTechs;
  ArmyComposition m_currentTargetArmyComposition;
};
