klips/cpp/patterns/factory/parts.hpp

27 lines
497 B
C++
Raw Permalink Normal View History

2021-05-11 19:04:58 +00:00
#ifndef PARTS_HPP
#define PARTS_HPP
#include <string>
class Part {
public:
std::string getName() const { return partName;}
float getPrice() const { return partPrice;}
protected:
std::string partName; // The name of the part
float partPrice; // The partPrice of the part
};
/*****************************************************************************/
// Gear
class Gear : public Part {
public:
explicit Gear(std::string name="Gear", float price = 1.0f);
};
#endif // PARTS_HPP