#pragma once

#include "PathElement.h"
#include "PointCollection.h"

#include <vector>
#include <string>

class Line : public PathElement
{
public:
    enum class InputBufferType
    {
        HORIZONTAL_REL,
        HORIZONTAL_ABS,
        VERTICAL_REL,
        VERTICAL_ABS,
        XY_REL,
        XY_ABS
    };

    Line(const Point& start, const PointCollection& points);

    Line(const Point& start, InputBufferType bufferType, const std::vector<double>& buffer);

    const PointCollection& getPoints() const;

    Line::Type getType() const override;

    const Point& getLocation() const override;

    Bounds getBounds() const override;

    Point getFirstPoint() const override;

    Point getEndPoint() const override;

    void sample(SparseGrid<bool>*) const override {};

    std::string toPostScriptString(std::size_t precision = 0) const override;

private:
    Point mStartPoint;
    PointCollection mPoints;
};
