I wanted to know how to use make shared with factory pattern. There are many drawFilled functions, want to joint them and use it with the parent class. Need to add every single Header file for every class type, for example, I have the main parent class with one header file, where there are the inherited classes such as Circle, Square, etc. My main purpose here is that I want to know how to add one single Header file and use all of those classes types.
vector<shared_ptr<shape_Object>> v_figure_ptr;
v_figure_ptr.push_back(make_shared<Triangle>(Colors::skyblue, vec2{ figure_posX,figure_posY }, figure_size));
v_figure_ptr.push_back(shape_Object::Create("Triangle", Colors::gold, vec2{figure_posX,figure_posY},figure_size, 0));
Aucun commentaire:
Enregistrer un commentaire