最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
例程实作 ----庖丁解羊(下)(转)
时间:2022-07-02 18:06:13 编辑:袖梨 来源:一聚教程网
例程实作
----庖丁解羊(下)
#include
#include
using namespace std;
class Part{
public:
virtual void Draw()=0;
virtual ~Part(){}
};
class Shape{
public:
Shape( string const& _s ):data( _s ){}
void Draw( unsigned color )
{
cout << data << " with color :" << hex << color << endl;
} //提供了借口,但是没有实现绘图
private:
string data;
//读者可以自己实现绘图部分
};
//绒毛,骨架,胸,腹,背,眼睛,鼻子,嘴巴,心,脾,肝,肠,肾,脚,尾巴,耳朵,肺,胃{{部分,显示=轮廓+颜色},轮廓[1],颜色[1]}
class BasePart : public Part{
public:
BasePart( string const& _s , unsigned _c ):shape( _s ),color( _c ){}
void Draw()
{
shape.Draw( color );
}
private:
Shape shape;
----庖丁解羊(下)
#include
#include
using namespace std;
class Part{
public:
virtual void Draw()=0;
virtual ~Part(){}
};
class Shape{
public:
Shape( string const& _s ):data( _s ){}
void Draw( unsigned color )
{
cout << data << " with color :" << hex << color << endl;
} //提供了借口,但是没有实现绘图
private:
string data;
//读者可以自己实现绘图部分
};
//绒毛,骨架,胸,腹,背,眼睛,鼻子,嘴巴,心,脾,肝,肠,肾,脚,尾巴,耳朵,肺,胃{{部分,显示=轮廓+颜色},轮廓[1],颜色[1]}
class BasePart : public Part{
public:
BasePart( string const& _s , unsigned _c ):shape( _s ),color( _c ){}
void Draw()
{
shape.Draw( color );
}
private:
Shape shape;
相关文章
- 王者荣耀10周年3千点券这么花-十周年3000点券使用建议 10-13
- 明日方舟真言值得抽吗-真言抽取建议 10-13
- 永劫无间手游南宫锦武器选哪个好-南宫锦武器选择推荐 10-13
- 王者荣耀月之回廊入口在哪-月之回廊入口位置介绍 10-13
- 羊蹄山之魂的时代背景是什么 羊蹄山之魂时代故事背景介绍 10-13
- 洛克王国世界吉格斯怎么打-吉格斯打法攻略 10-13