From 87c24bd20035bd62e3b1f21cd867f0d8636bbc52 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 23 Mar 2020 21:26:06 +0100 Subject: Randomly place stones on a board --- svg.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 svg.h (limited to 'svg.h') diff --git a/svg.h b/svg.h new file mode 100644 index 0000000..d3f2120 --- /dev/null +++ b/svg.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include + + +struct Figure { + Figure() = default; + inline virtual ~Figure() {} + Figure(const Figure &other) = default; + Figure(Figure &&other) = default; + Figure& operator=(const Figure &other) = default; + Figure& operator=(Figure &&other) = default; + virtual std::string svg() const = 0; +}; + +struct Polygon final : public Figure { + std::vector> pts; + std::string bg; + + Polygon(std::vector> pts, std::string bg); + + std::string svg() const override; +}; + +struct Text final : public Figure { + double x, y; + double rotation; + std::string text; + + Text(double x, double y, double rotation, std::string text); + + std::string svg() const override; +}; -- cgit v1.2.3-54-g00ecf