#pragma once

#include <QObject>

#include "Geometry/WimaAreaData.h"
#include "Geometry/WimaCorridorData.h"
#include "Geometry/WimaJoinedAreaData.h"
#include "Geometry/WimaMeasurementAreaData.h"
#include "Geometry/WimaServiceAreaData.h"
#include "MissionItem.h"

class WimaPlanData : public QObject {
  Q_OBJECT
public:
  WimaPlanData(QObject *parent = nullptr);
  WimaPlanData(const WimaPlanData &other, QObject *parent = nullptr);
  WimaPlanData &operator=(const WimaPlanData &other);

  // Member Methodes
  void append(const WimaJoinedAreaData &areaData);
  void append(const WimaServiceAreaData &areaData);
  void append(const WimaCorridorData &areaData);
  void append(const WimaMeasurementAreaData &areaData);
  //!
  //! \brief append
  //! \param missionItems
  //! \note Takes owenership of MissionItems*
  void append(const QList<MissionItem *> &missionItems);
  void clear();

  const QList<const WimaAreaData *> &areaList() const;
  const QList<MissionItem> &missionItems() const;

signals:
  void areaListChanged();

private:
  void _clearAndDeleteMissionItems();

private:
  WimaJoinedAreaData _joinedArea;
  WimaServiceAreaData _serviceArea;
  WimaCorridorData _corridor;
  WimaMeasurementAreaData _measurementArea;
  QList<const WimaAreaData *> _areaList;

  QList<MissionItem> _missionItems;
};
