2021-05-11 16:50:28 -04:00
|
|
|
#ifndef Item_h_
|
|
|
|
#define Item_h_
|
|
|
|
|
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-24 02:45:09 -04:00
|
|
|
#include "extension.hpp"
|
2021-06-24 17:53:58 -04:00
|
|
|
#include "Node.hpp"
|
2021-09-20 02:33:32 -04:00
|
|
|
#include "Texture.hpp"
|
2021-05-11 16:50:28 -04:00
|
|
|
|
2021-06-24 17:53:58 -04:00
|
|
|
class Item : public Node
|
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-09-20 02:33:32 -04:00
|
|
|
std::vector<Texture> image_textures;
|
2021-05-11 16:50:28 -04:00
|
|
|
std::string brand_name = "", product_name = "", upc = "";
|
2021-05-12 02:09:22 -04:00
|
|
|
int current_image_index = 0;
|
2021-05-11 16:50:28 -04:00
|
|
|
void set_text_property(const std::string&, std::string&, const std::string&);
|
|
|
|
|
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
|
|
|
|
|
|
|
Item(Node*);
|
2021-09-20 02:33:32 -04:00
|
|
|
void add_image_texture(Texture);
|
|
|
|
const std::vector<Texture>& get_image_textures() const;
|
|
|
|
const Texture& get_active_image_texture() const;
|
2021-05-11 16:50:28 -04:00
|
|
|
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;
|
2021-05-12 02:09:22 -04:00
|
|
|
void increment_image_index(int = 1);
|
2021-05-11 16:50:28 -04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|