#pragma once
#ifdef USE_SPAR_GUI
#include "Utils/Component.h"
#include "SparAIContainer.h"

class SparObserver : public Process
{
  // At the moment there's nothing here but notifications may be added at some point, I guess.

public:
  SparObserver(const SparAIContainer* spar)
    : Process(spar)
  {
  }

  virtual void onFrame() = 0;

protected:
  virtual void onStart()
  {
    m_ID = dynamic_cast<const SparAIContainer*>(getParent())->addObserver(this);
  }
  virtual void onEnd()
  {
    dynamic_cast<const SparAIContainer*>(getParent())->removeObserver(m_ID);
  }

private:
  friend class SparAIContainer;

  SparAIContainer::ObserverID m_ID;
};

#endif