#include <iostream>
#include <vector>
#include <memory>
using namespace std;

using ElementTypes = int;
const int DOT=1;

class Element {
public:
    ElementTypes type = DOT;

    Element() {}
    Element(ElementTypes type) : type(type) {}

    virtual void Draw() { }
};
class Dot : public Element {
public:
    int x, y;

    Dot(int x, int y) : x(x), y(y) {}

    void Draw() override {
        cout<<"DrawCircle("<<x<<","<< y<<", 2.f, BLACK);"<<endl; 
    }
    ~Dot() { x=-1; y=-1; cout<<"Destroyed"<<endl; } //just to demonstrate before and after destruction
};
class Drawing {
public:
    std::vector<shared_ptr<Element>> Elements;

    void AddDot(shared_ptr<Element> dot) {
        Elements.emplace_back(dot);
    }

    void Draw() { 
        for (auto element : Elements) {
            element->Draw();
        }
    }
};
void init (Drawing&d) {
	auto dt1 = make_shared<Dot>(10,30); 
	d.AddDot(dt1);
}
int main() {
	Drawing d; 
	init (d);
	d.Draw(); 
}