Pizzerie
Toggle main menu visibility
Loading...
Searching...
No Matches
Pizza.h
Go to the documentation of this file.
1
5
6
#ifndef PROOP_PIZZA_H
7
#define PROOP_PIZZA_H
8
#include "
IMenuItem.h
"
9
#include "
Ingredient.h
"
10
#include "
MenuItem.h
"
11
18
class
Pizza
:
public
MenuItem
{
19
private
:
20
int
diameter
;
21
bool
hasExtraCheese
;
22
Ingredient
**
ingredients
;
23
int
maxIngredients
;
24
int
currentIngredients
= 0;
25
26
public
:
30
Pizza
();
31
40
Pizza
(
string
n,
double
b,
int
d,
bool
e,
int
m);
41
45
~Pizza
();
46
52
bool
addIngredient
(
Ingredient
* i);
53
59
bool
removeIngredient
(
string
name
);
60
65
double
getPrice
()
const override
;
66
71
string
printInfo
()
override
;
72
77
int
getDiameter
();
78
};
79
80
#endif
//PROOP_PIZZA_H
IMenuItem.h
Hlavičkový soubor pro rozhraní IMenuItem.
Ingredient.h
Hlavičkový soubor pro třídu Ingredient.
MenuItem.h
Hlavičkový soubor pro základní třídu MenuItem.
Ingredient
Třída reprezentující přísadu (např. na pizzu).
Definition
Ingredient.h:15
MenuItem::name
string name
Název položky.
Definition
MenuItem.h:17
MenuItem::MenuItem
MenuItem(string n, double b)
Konstruktor položky menu.
Definition
MenuItem.cpp:7
Pizza::printInfo
string printInfo() override
Vypíše informace o pizze.
Definition
Pizza.cpp:37
Pizza::maxIngredients
int maxIngredients
Maximální kapacita pole ingrediencí
Definition
Pizza.h:23
Pizza::currentIngredients
int currentIngredients
Aktuální počet přidaných ingrediencí
Definition
Pizza.h:24
Pizza::Pizza
Pizza()
Výchozí konstruktor (nastaví základní hodnoty).
Definition
Pizza.cpp:7
Pizza::diameter
int diameter
Průměr pizzy v cm.
Definition
Pizza.h:20
Pizza::getPrice
double getPrice() const override
Získá celkovou cenu pizzy.
Definition
Pizza.cpp:29
Pizza::ingredients
Ingredient ** ingredients
Dynamické pole ukazatelů na ingredience.
Definition
Pizza.h:22
Pizza::~Pizza
~Pizza()
Destruktor. Uvolňuje paměť všech alokovaných ingrediencí.
Definition
Pizza.cpp:21
Pizza::removeIngredient
bool removeIngredient(string name)
Odebere ingredienci z pizzy podle názvu.
Definition
Pizza.cpp:56
Pizza::getDiameter
int getDiameter()
Vrátí průměr pizzy.
Definition
Pizza.cpp:42
Pizza::addIngredient
bool addIngredient(Ingredient *i)
Přidá ingredienci na pizzu.
Definition
Pizza.cpp:46
Pizza::hasExtraCheese
bool hasExtraCheese
Indikátor extra sýra.
Definition
Pizza.h:21
Pizza.h
Generated by
1.17.0