This repository has been archived on 2022-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
patterns-old/lesson_3/Milk.hpp

27 lines
449 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Milk.hpp
*
* Created on: 1 нояб. 2021 г.
* Author: alexander
*/
#pragma once
#include "CondimentDecorator.hpp"
class Milk: public CondimentDecorator
{
public:
Milk(Beverage *beverage): CondimentDecorator(beverage) {}
std::string getDescription() const override
{
return beverage->getDescription() + ", Milk";
}
double cost() const override
{
return 0.10 + beverage->cost();
}
};