First_Commit
This commit is contained in:
22
include/Drink.hpp
Normal file
22
include/Drink.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_DRINK_HPP
|
||||
#define OOP_DRINK_HPP
|
||||
|
||||
#include <stdexcept>
|
||||
#include "Food.hpp"
|
||||
#include "Ingredients.hpp"
|
||||
|
||||
class Drink final : public Food {
|
||||
private:
|
||||
int ml;
|
||||
public:
|
||||
Drink(Production id);
|
||||
virtual void MakeFood() override;
|
||||
void MakeLarger();
|
||||
int GetMl();
|
||||
};
|
||||
|
||||
#endif // OOP_DRINK_HPP
|
||||
25
include/Food.hpp
Normal file
25
include/Food.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_FOOD_HPP
|
||||
#define OOP_FOOD_HPP
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "Ingredients.hpp"
|
||||
|
||||
class Food {
|
||||
protected:
|
||||
Production id;
|
||||
std::vector<Ingredients> ingredient;
|
||||
int money;
|
||||
public:
|
||||
Food(Production id);
|
||||
Production getId() const;
|
||||
std::vector<Ingredients> GetIngredient();
|
||||
virtual void MakeFood() = 0;
|
||||
int GetMoney();
|
||||
};
|
||||
|
||||
#endif // OOP_FOOD_HPP
|
||||
41
include/Ingredients.hpp
Normal file
41
include/Ingredients.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_INGREDIENTS_H
|
||||
#define OOP_INGREDIENTS_H
|
||||
|
||||
enum class Ingredients: unsigned long long{
|
||||
_NULL = 0,
|
||||
PorkSteak,
|
||||
BeefSteak,
|
||||
FishSteak,
|
||||
BurgerBread,
|
||||
Lattuce,
|
||||
Cheese,
|
||||
FranchFries,
|
||||
ChickenNugget,
|
||||
Salad,
|
||||
Cola,
|
||||
Spirit,
|
||||
Milktea,
|
||||
Caramel,
|
||||
Coffee,
|
||||
Milk,
|
||||
};
|
||||
|
||||
enum class Production: unsigned long long {
|
||||
_NULL = 0,
|
||||
PorkBurger,
|
||||
BeefBurger,
|
||||
FishBurger,
|
||||
Frenchfries,
|
||||
Nugget,
|
||||
Salad,
|
||||
Cola,
|
||||
Spirit,
|
||||
CaramelMilktea,
|
||||
Latte,
|
||||
};
|
||||
|
||||
#endif // OOP_INGREDIENTS_H
|
||||
22
include/MainDish.hpp
Normal file
22
include/MainDish.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_MAINDISH_HPP
|
||||
#define OOP_MAINDISH_HPP
|
||||
|
||||
#include "Food.hpp"
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include "Ingredients.hpp"
|
||||
|
||||
class MainDish : public Food {
|
||||
private:
|
||||
std::vector<Ingredients> addtional;
|
||||
public:
|
||||
MainDish(Production id);
|
||||
void MakeFood() override;
|
||||
void AddIngredients(std::vector<Ingredients> addtional);
|
||||
};
|
||||
|
||||
#endif // OOP_MAINDISH_HPP
|
||||
24
include/OishiiPapa.hpp
Normal file
24
include/OishiiPapa.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef OISHII_PAPA_HPP
|
||||
#define OISHII_PAPA_HPP
|
||||
|
||||
#include "Drink.hpp"
|
||||
#include "MainDish.hpp"
|
||||
#include "SideDish.hpp"
|
||||
#include "Package.hpp"
|
||||
#include "Order.hpp"
|
||||
#include <queue>
|
||||
class OishiiPapa{
|
||||
private:
|
||||
std::queue<Order> pipeline;
|
||||
std::queue<Package> chest;
|
||||
int money = 0;
|
||||
public:
|
||||
OishiiPapa();
|
||||
void MakeDish();
|
||||
void SendOrder(Order order);
|
||||
Package Pickup();
|
||||
int GetMoney();
|
||||
Order GetOrderInfo();
|
||||
};
|
||||
|
||||
#endif
|
||||
19
include/Order.hpp
Normal file
19
include/Order.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef ORDER_HPP
|
||||
#define ORDER_HPP
|
||||
|
||||
#include <vector>
|
||||
#include "Ingredients.hpp"
|
||||
|
||||
class Order{
|
||||
private:
|
||||
std::vector<Production> product;
|
||||
std::vector<Ingredients> addtional;
|
||||
std::vector<bool> larger;
|
||||
public:
|
||||
Order(std::vector<Production> product, std::vector<Ingredients> addtional ,std::vector<bool> larger);
|
||||
std::vector<Production> GetProductInfo();
|
||||
std::vector<Ingredients> GetAddtionalInfo();
|
||||
std::vector<bool> GetLargerInfo();
|
||||
};
|
||||
|
||||
#endif
|
||||
29
include/Package.hpp
Normal file
29
include/Package.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_PACKAGE_HPP
|
||||
#define OOP_PACKAGE_HPP
|
||||
|
||||
#include "MainDish.hpp"
|
||||
#include "SideDish.hpp"
|
||||
#include "Drink.hpp"
|
||||
#include <stdexcept>
|
||||
#include <memory>
|
||||
|
||||
class Package {
|
||||
private:
|
||||
std::shared_ptr<MainDish> maindish = nullptr;
|
||||
std::shared_ptr<SideDish> sidedish = nullptr;
|
||||
std::shared_ptr<Drink> drink = nullptr;
|
||||
int money = 0;
|
||||
public:
|
||||
Package();
|
||||
void CountMoney();
|
||||
void SetMainDish(MainDish maindish);
|
||||
void SetSideDish(SideDish sidedish);
|
||||
void SetDrink(Drink drink);
|
||||
int GetMoney();
|
||||
};
|
||||
|
||||
#endif // OOP_PACKAGE_HPP
|
||||
28
include/SideDish.hpp
Normal file
28
include/SideDish.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Created by User on 2024/10/29.
|
||||
//
|
||||
|
||||
#ifndef OOP_SIDEDISH_HPP
|
||||
#define OOP_SIDEDISH_HPP
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include "Food.hpp"
|
||||
#include "Ingredients.hpp"
|
||||
|
||||
enum class SideDishType {
|
||||
BIG = 0,
|
||||
SMALL = 1
|
||||
};
|
||||
|
||||
class SideDish final : public Food {
|
||||
private:
|
||||
SideDishType type = SideDishType::SMALL;
|
||||
public:
|
||||
SideDish(Production id);
|
||||
void MakeFood() override;
|
||||
void MakeLarger();
|
||||
SideDishType GetType();
|
||||
};
|
||||
|
||||
#endif // OOP_SIDEDISH_HPP
|
||||
Reference in New Issue
Block a user