8#include <nlohmann/json.hpp>
30 this->
m_shape = std::move(p.m_shape);
37 this->
m_shape = std::move(p.m_shape);
49 nlohmann::json json =
"{}"_json;
56 json[
"points"] = nlohmann::json::array();
59 auto obj = nlohmann::json::object();
63 json[
"points"].push_back(obj);
71 const auto& col = json.at(
"colour");
77 meta::vector<glm::vec2> points;
79 const auto& pa = json.at(
"points");
80 for (
const auto& point : pa)
82 points.emplace_back(point.at(
"x"), point.at(
"y"));
nlohmann::json serialize() override
Serializes object.
virtual ~Polyline()
Destructor.
void deserialize(const nlohmann::json &json) override
Deserializes from object.
Polyline & operator=(Polyline &&)
Move assignment operator.
graphics::Polyline m_shape
Shape.
void set_g(const std::uint8_t g)
Green.
void set_r(const std::uint8_t r)
Red.
void set_b(const std::uint8_t b)
Blue.
void set_a(const std::uint8_t a)
Alpha.
void create(const meta::vector< glm::vec2 > &points)
List of points to create a line from.
const meta::vector< glm::vec2 > & points() const
Get list of points.
Colour m_colour
Used by all primitives.