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_4/Veggies.hpp

88 lines
1.1 KiB
C++
Raw Permalink 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.

/*
* Veggies.hpp
*
* Created on: 3 нояб. 2021 г.
* Author: alexander
*/
#pragma once
#include <string>
class Veggies {
public:
virtual std::string toString() const = 0;
virtual ~Veggies() {}
};
class BlackOlivesVeggies: public Veggies
{
public:
std::string toString() const
{
return "Black Olives";
}
};
class EggplantVeggies: public Veggies
{
public:
std::string toString() const
{
return "Eggplant";
}
};
class MushroomVeggies: public Veggies
{
public:
std::string toString() const
{
return "Mushrooms";
}
};
class GarlicVeggies: public Veggies
{
public:
std::string toString() const
{
return "Garlic";
}
};
class RedPepperVeggies: public Veggies
{
public:
std::string toString() const
{
return "Red Pepper";
}
};
class SpinachVeggies: public Veggies
{
public:
std::string toString() const
{
return "Spinach";
}
};
class OnionVeggies: public Veggies
{
public:
std::string toString() const
{
return "Onion";
}
};