QtDesignPatterns/facadepattern/interface.h

38 lines
463 B
C
Raw Permalink 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 Square: public Shape
{
public:
void draw()
{
cout << "draw Square" << endl;
}
};
class Circle: public Shape
{
public:
void draw()
{
cout << "draw Circle" << endl;
}
};
class Rectangle: public Shape
{
public:
void draw()
{
cout << "draw Rectangle" << endl;
}
};