42 lines
765 B
C++
42 lines
765 B
C++
/*
|
||
* Soy.hpp
|
||
*
|
||
* Created on: 1 нояб. 2021 г.
|
||
* Author: alexander
|
||
*/
|
||
|
||
#pragma once
|
||
|
||
#include "CondimentDecorator.hpp"
|
||
|
||
class Soy: public CondimentDecorator
|
||
{
|
||
public:
|
||
Soy(Beverage *beverage) : CondimentDecorator(beverage) {}
|
||
|
||
std::string getDescription() const override
|
||
{
|
||
return beverage->getDescription() + ", Soy";
|
||
}
|
||
|
||
double cost() const override
|
||
{
|
||
double cost = 0.15 + beverage->cost();
|
||
|
||
if (beverage->getSize() == Size::TALL)
|
||
{
|
||
cost += .10;
|
||
}
|
||
else if (beverage->getSize() == Size::GRANDE)
|
||
{
|
||
cost += .15;
|
||
}
|
||
else if (beverage->getSize() == Size::VENTI)
|
||
{
|
||
cost += .20;
|
||
}
|
||
|
||
return cost;
|
||
}
|
||
};
|