QtDesignPatterns/decoratorpattern/first_interface.h

29 lines
355 B
C
Raw Normal View History

2024-02-06 17:21:37 +08:00
#include <iostream>
using namespace std;
class Shape
{
public:
Shape(){}
virtual ~Shape(){}
virtual void draw() = 0;
};
class Rectangle: public Shape
{
public:
void draw()
{
cout << "draw Rectangle" << endl;
}
};
class Circle: public Shape
{
public:
void draw()
{
cout << "draw Circle" << endl;
}
};