patterns/decorator/coffeewithsize/beverage.d

28 lines
409 B
D

module decorator.coffeewithsize.beverage;
abstract class Beverage
{
protected:
string description = "Unknown Beverage";
public:
enum Size { TALL, GRANDE, VENTI }
Size size = Size.TALL;
string getDescription()
{
return description;
}
void setSize(Size size)
{
this.size = size;
}
Size getSize()
{
return size;
}
double cost();
}