#include "GeneratorBase.h"

#include <QGeoCoordinate>

namespace routing {

class LinearGenerator : public GeneratorBase {
  Q_OBJECT
public:
  LinearGenerator(QObject *parent = nullptr);
  LinearGenerator(Data d, QObject *parent = nullptr);

  Q_PROPERTY(Fact *distance READ distance CONSTANT)
  Q_PROPERTY(Fact *alpha READ alpha CONSTANT)
  Q_PROPERTY(Fact *minLength READ minLength CONSTANT)

  virtual QString editorQml() override;

  virtual QString name() override;
  virtual QString abbreviation() override;

  virtual bool get(Generator &generator) override;

  Fact *distance();
  Fact *alpha();
  Fact *minLength();

  static const char *settingsGroup;
  static const char *distanceName;
  static const char *alphaName;
  static const char *minLengthName;

protected:
  virtual void establishConnections() override;
  virtual void deleteConnections() override;

private:
  bool _connectionsEstablished;

  QMap<QString, FactMetaData *> _metaDataMap;
  SettingsFact _distance;
  SettingsFact _alpha;
  SettingsFact _minLength;
};

} // namespace routing
