65 lines
2.4 KiB
C++
65 lines
2.4 KiB
C++
/* _______________ +---------------------------------------------------------------------------------------+
|
|
//~~~~~~~~~~~~~\\ | a game by @ohsqueezy & @sleepin |
|
|
//```````````````\\ | [ohsqueezy.itch.io] [instagram.com/sleepin] |
|
|
//_0_0_0_0_0_0_0_0_\\ | |
|
|
//_/_/_/_/___\_\_\_\_\\ | with code licensed for copy, modification and redistribution [git.nugget.fun/pudding] |
|
|
//GGGUUUNNNKKKIIISSSSSS\\ | |
|
|
//_/__/__/__/_\__\__\__\_\\ | 😀 Thank you for choosing Puddendo for your business 😀 |
|
|
+---------------------------------------------------------------------------------------+ */
|
|
#ifndef Item_h_
|
|
#define Item_h_
|
|
|
|
/* including so we can use GLuint type */
|
|
#if defined(__EMSCRIPTEN__)
|
|
#include <GL/glew.h>
|
|
#else
|
|
#include "glew/glew.h"
|
|
#endif
|
|
|
|
#include <vector>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <memory>
|
|
#include <functional>
|
|
#include <SDL.h>
|
|
#include "json/json.hpp"
|
|
#include "extension.hpp"
|
|
#include "Node.hpp"
|
|
#include "Texture.hpp"
|
|
#include "Log.hpp"
|
|
|
|
class Item : public Node
|
|
{
|
|
|
|
private:
|
|
|
|
nlohmann::json json = {};
|
|
std::vector<Texture> image_textures;
|
|
std::string brand_name = "", product_name = "", upc = "";
|
|
int current_image_index = 0;
|
|
void set_text_property(const std::string&, std::string&, const std::string&);
|
|
|
|
/*
|
|
* add properties: ingredients, protein weight, nutrition grade, popularity, "serving unit", keywords,
|
|
* allergens, calories, fat, saturated fat, cholesterol, sodium, carbohydrates, fiber, sugar, potassium
|
|
*/
|
|
|
|
public:
|
|
|
|
Item(Node*);
|
|
void add_image_texture(Texture);
|
|
const std::vector<Texture>& get_image_textures() const;
|
|
const Texture& get_active_image_texture() const;
|
|
void set_brand_name(const std::string&);
|
|
const std::string& get_brand_name() const;
|
|
void set_product_name(const std::string&);
|
|
const std::string& get_product_name() const;
|
|
void set_upc(const std::string&);
|
|
const std::string& get_upc() const;
|
|
std::string get_full_name() const;
|
|
void increment_image_index(int = 1);
|
|
|
|
};
|
|
|
|
#endif
|