This repository has been archived on 2022-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
patterns/decorator/coffeewithsize/beverage.d

28 lines
409 B
D
Raw Permalink Normal View History

2022-11-11 12:51:42 +00:00
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();
}