#pragma once
#include "../Scenario.h"
#include "../../DecisionMaking/Layer2Actions/Layer2Managers/Layer2Managers.h"

class TestBuildScenario : public Scenario<TestBuildScenario>
{
public:
  TestBuildScenario()
    : m_build(*this)
  {}

  template <class SparAIFactory>
  SparAIContainer* instantiateSparAIImpl(SparAIFactory& sparFactory)
  {
    typedef SparAIModule<Layer1GameState, Layer2Cueing, Layer3TacticalRecognition, Layer4StrategicRecognition,
                         Layer1FSM, Layer2Managers, InactiveLayer3, InactiveLayer4> SPAR;

    return sparFactory.instantiate<Layer1GameState, Layer2Cueing, Layer3TacticalRecognition, Layer4StrategicRecognition,
                                   Layer1FSM, Layer2Managers, InactiveLayer3, InactiveLayer4>(this);
  }

protected:
  virtual void onSparStarted(void* data)
  {
    m_build = Layer2Managers::getInstance().instantiateBuild(
        this,
        100,
        Spar->getPerceptualState()->getMap(), 
        BWAPI::UnitTypes::Protoss_Cybernetics_Core      
      );
    m_build->start();
  }

  void _output(std::ostream &out) const
  {
    out << "TestBuild Scenario";
  }

  ProcessContainer<Build> m_build;
};