#pragma once
#include "../../../Utils/SafeListAdaptor.h"
#include "../Layer1Reactive.h"
#include "Layer1FSMUnitData.h"
#include "Arbitrator.h"

class Layer1FSM : public Layer1Reactive
{
public:
  Layer1FSM(Layer1GameState& layer1GameState)
    : Layer1Reactive(layer1GameState)
  {
  }

  Arbitration& getArbitrator() { return m_arbitrator; }

  static Layer1FSM& getInstance()
  {
    return static_cast<Layer1FSM&>(Layer1Reactive::getInstance());
  }

  typedef Layer1FSMUnitData L1UnitData;

  void onFrame()
  {
    Layer1Reactive::onFrame();
    m_arbitrator.onFrame();
  }
protected:
  virtual void onStart()
  {
    Layer1Reactive::onStart();
    m_arbitrator.onStart();
  }
  virtual void onEnd()
  {
    Layer1Reactive::onEnd();
    m_arbitrator.onEnd();
  }

  Arbitration m_arbitrator;
};
