2021-10-18 17:34:17 -04:00
|
|
|
/* _______________ ,----------------------------------------------------------------.
|
|
|
|
//`````````````\\ \ \
|
|
|
|
//~~~~~~~~~~~~~~~\\ \ by @ohsqueezy & @sleepin \
|
|
|
|
//=================\\ \ [ohsqueezy.itch.io] [sleepin.itch.io] \
|
|
|
|
// \\ \ \
|
|
|
|
// \\ \ code released under the zlib license [git.nugget.fun/pudding] \
|
|
|
|
// ☆ GUNKISS ☆ \\ \ \
|
|
|
|
//_________________________\\ `---------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifndef ITEM_H_
|
|
|
|
#define ITEM_H_
|
2021-05-11 16:50:28 -04:00
|
|
|
|
2021-07-07 20:16:58 -04:00
|
|
|
/* including so we can use GLuint type */
|
|
|
|
#if defined(__EMSCRIPTEN__)
|
|
|
|
#include <GL/glew.h>
|
|
|
|
#else
|
|
|
|
#include "glew/glew.h"
|
|
|
|
#endif
|
|
|
|
|
2021-05-11 16:50:28 -04:00
|
|
|
#include <vector>
|
2021-06-24 17:53:58 -04:00
|
|
|
#include <sstream>
|
2021-05-11 16:50:28 -04:00
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
2021-06-24 17:53:58 -04:00
|
|
|
#include <functional>
|
2021-05-11 16:50:28 -04:00
|
|
|
#include <SDL.h>
|
2021-09-14 20:14:15 -04:00
|
|
|
#include "json/json.hpp"
|
2021-09-20 02:33:32 -04:00
|
|
|
#include "Texture.hpp"
|
2021-10-02 19:39:46 -04:00
|
|
|
#include "Log.hpp"
|
2021-10-26 16:37:05 -04:00
|
|
|
#include "Model.hpp"
|
2021-11-01 17:35:16 -04:00
|
|
|
#include "Carousel.hpp"
|
2021-05-11 16:50:28 -04:00
|
|
|
|
2021-11-01 17:35:16 -04:00
|
|
|
class Item
|
2021-05-11 16:50:28 -04:00
|
|
|
{
|
2021-10-02 19:39:46 -04:00
|
|
|
|
2021-05-11 16:50:28 -04:00
|
|
|
private:
|
2021-06-24 17:53:58 -04:00
|
|
|
|
2021-09-14 20:14:15 -04:00
|
|
|
nlohmann::json json = {};
|
2021-11-16 23:21:24 -05:00
|
|
|
Plane item_view;
|
2021-11-01 17:35:16 -04:00
|
|
|
Carousel carousel;
|
|
|
|
std::string item_brand_name = "", item_product_name = "", item_upc = "";
|
|
|
|
void text_property(const std::string&, std::string&, const std::string&);
|
2021-05-11 16:50:28 -04:00
|
|
|
|
2021-06-24 17:53:58 -04:00
|
|
|
/*
|
|
|
|
* add properties: ingredients, protein weight, nutrition grade, popularity, "serving unit", keywords,
|
|
|
|
* allergens, calories, fat, saturated fat, cholesterol, sodium, carbohydrates, fiber, sugar, potassium
|
|
|
|
*/
|
|
|
|
|
2021-05-11 16:50:28 -04:00
|
|
|
public:
|
2021-06-24 17:53:58 -04:00
|
|
|
|
2021-11-01 17:35:16 -04:00
|
|
|
Item();
|
|
|
|
void texture(sb::Texture&, const std::string&);
|
|
|
|
void brand_name(const std::string&);
|
|
|
|
const std::string& brand_name() const;
|
|
|
|
void product_name(const std::string&);
|
|
|
|
const std::string& product_name() const;
|
|
|
|
void upc(const std::string&);
|
|
|
|
const std::string& upc() const;
|
|
|
|
std::string full_name() const;
|
|
|
|
sb::Texture& current_texture();
|
|
|
|
void next_texture();
|
|
|
|
void previous_texture();
|
|
|
|
std::size_t texture_count();
|
2021-11-16 23:21:24 -05:00
|
|
|
Plane& view();
|
|
|
|
bool at_first() const;
|
|
|
|
bool at_last();
|
2021-11-19 14:14:42 -05:00
|
|
|
void to_first();
|
|
|
|
void to_last();
|
2021-05-11 16:50:28 -04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2022-09-19 22:21:17 -04:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
/*!
|
|
|
|
* Support passing item objects to the global stream operator.
|
|
|
|
*
|
|
|
|
* @param out The output stream
|
|
|
|
* @param item The item to be printed
|
|
|
|
* @return The submitted output stream with the text representation of item added
|
|
|
|
*/
|
|
|
|
std::ostream& operator<<(std::ostream& out, const Item& item);
|
|
|
|
}
|
|
|
|
|
2021-05-11 16:50:28 -04:00
|
|
|
#endif
|