Add abstract-factory pattern example
This commit is contained in:
19
cpp/patterns/abstract-factory/parts.cpp
Normal file
19
cpp/patterns/abstract-factory/parts.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#include "parts.hpp"
|
||||
|
||||
/*****************************************************************************/
|
||||
// Gear
|
||||
|
||||
Gear::Gear(std::string name, float price) {
|
||||
partName = name;
|
||||
partPrice = price;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
// Spring
|
||||
|
||||
Spring::Spring(std::string name, float price) {
|
||||
partName = name;
|
||||
partPrice = price;
|
||||
}
|
||||
Reference in New Issue
Block a user