2021-05-11 16:50:28 -04:00
|
|
|
#ifndef Item_h_
|
|
|
|
#define Item_h_
|
|
|
|
|
|
|
|
#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-05-12 02:09:22 -04:00
|
|
|
#include <extension.hpp>
|
2021-06-24 17:53:58 -04:00
|
|
|
#include "Node.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-05-11 16:50:28 -04:00
|
|
|
std::vector<std::shared_ptr<SDL_Texture>> image_textures;
|
|
|
|
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*);
|
|
|
|
void add_image_texture(std::shared_ptr<SDL_Texture> SDL_Texture);
|
2021-05-11 16:50:28 -04:00
|
|
|
const std::vector<std::shared_ptr<SDL_Texture>>& get_image_textures() const;
|
2021-05-12 02:09:22 -04:00
|
|
|
const std::shared_ptr<SDL_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
|