#pragma once

#include "component_button.h"

#include "../../entity/play/entity_icon.h"
#include "../../entity/play/entity_streak_square.h"

#include "../stat/component_shop_item.h"

#define SHOP_BUTTON_SPRITE_Z_OFFSET -0.01f

static const vec2 SHOP_BUTTON_SIZE = {96.0f, 96.0f};
static const vec2 SHOP_BUTTON_STREAK_SIZE = {128.0f, 128.0f};

typedef struct ComponentShopButton
{
	ECSComponent component;
	u32 shopItemID;
	u32 streakID;
	u32 priceTextStreakID;
	u32 countTextStreakID;
	u32 priceTextID;
	u32 countTextID;
	u32 affectedID;
} ComponentShopButton;

void
component_shop_button_init
(
	ComponentShopButton* self, 
	ECS* ecs,
	vec3 position,
	u32 shopItemID
);

void component_shop_button_add(ComponentShopButton* self, ECS* ecs);
void component_shop_button_delete(ComponentShopButton* self, ECS* ecs);
void component_shop_button_tick(ComponentShopButton* self, ECS* ecs);

static const ECSComponentInfo COMPONENT_SHOP_BUTTON_INFO = 
{
	.system = 
	{
		.functions = 
		{ 
			(ECSFunction)component_shop_button_add, 
			(ECSFunction)component_shop_button_delete, 
			(ECSFunction)component_shop_button_tick, 
			NULL
		}
	},
	.type = ECS_COMPONENT_SHOP_BUTTON,
	.size = sizeof(ComponentShopButton)
};


