ultimatum424 / OOP

0 stars 0 forks source link

Замечания по Shapes #6

Open alexey-malov opened 8 years ago

alexey-malov commented 8 years ago

include stdafx.h в заголовочных файлах не размещают

alexey-malov commented 8 years ago
alexey-malov commented 8 years ago
alexey-malov commented 8 years ago
alexey-malov commented 8 years ago
alexey-malov commented 8 years ago
alexey-malov commented 8 years ago
alexey-malov commented 7 years ago
alexey-malov commented 7 years ago
alexey-malov commented 7 years ago
alexey-malov commented 7 years ago
class ICanvas
{
public:
    virtual void DrawLine(...) = 0;
    virtual void FillPolygon(...) = 0;
    // прочие методы рисования примитивов
};

class IShape
{
public:
    virtual void Draw(ICanvas & canvas) = 0;
};
alexey-malov commented 7 years ago
alexey-malov commented 7 years ago
void DoSomething(const IShape& shape)
{
    cout << shape.GetArea() << endl;
}

void Test()
{
    CCircle c({10, 20}, 30, "#000000", "#ffffff");
    DoSomething(c);
}