2018-07-22 14:50:54 +08:00
|
|
|
//
|
|
|
|
// Created by xiemenghui on 2018/7/20.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DESIGNPATTERN_CONCRETE_PRODUCT_H
|
|
|
|
#define DESIGNPATTERN_CONCRETE_PRODUCT_H
|
|
|
|
|
|
|
|
#include "product.h"
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
/********** Car **********/
|
|
|
|
// Benz
|
2018-07-22 14:50:54 +08:00
|
|
|
class BenzCar : public ICar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Benz Car";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
// BMW
|
2018-07-22 14:50:54 +08:00
|
|
|
class BmwCar : public ICar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Bmw Car";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
// Audi
|
2018-07-22 14:50:54 +08:00
|
|
|
class AudiCar : public ICar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Audi Car";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
/********** Bicycle **********/
|
|
|
|
// Benz
|
2018-07-22 14:50:54 +08:00
|
|
|
class BenzBike : public IBike
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Benz Bike";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
// BMW
|
2018-07-22 14:50:54 +08:00
|
|
|
class BmwBike : public IBike
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Bmw Bike";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
// Audi
|
2018-07-22 14:50:54 +08:00
|
|
|
class AudiBike : public IBike
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
string Name()
|
|
|
|
{
|
|
|
|
return "Audi Bike";
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //DESIGNPATTERN_CONCRETE_PRODUCT_H
|