#pragma once
#include "global.h"
//前置声明
struct MyView;
class Entity;
#define DMGNUM_TEXTURE L"dmgnum"
//伤害数字
struct NumEntity
{
	float x = 0, y = 0;//坐标
	float last_x = 0, last_y = 0;
	int num = 0;//显示的数字
	int style = 0;//数字的样式
	std::weak_ptr<Entity> entity;//关联的实体
	const int exist_time_max = 180;
	int exist_time = exist_time_max;
	const int timecounter_max = 60;
	int timecounter = timecounter_max;
};

struct QuestionMarkEntity
{
	float x = 0, y = 0;//坐标
	float last_x = 0, last_y = 0;
	const int timecounter_max = 160;
	const int disappear = 80;
	int timecounter = timecounter_max;
};

class DmgNum
{
public:
	void Init(MyDX11Renderer* pRenderer, MyView* pView);
	void Reset();
	void Step();
	void Draw(float delteTime);
	void SetNum(int val, float x, float y, int style, std::weak_ptr<Entity> e);
	void SetQuestionMark(float x, float y);//设置一个问号
private:
	MyDX11Renderer* pRenderer = nullptr;
	MyView* pView = nullptr;
	std::list<NumEntity> dmgList;//伤害值列表
	std::list<NumEntity> expList;//经验值列表
	std::list<NumEntity> recList;//恢复值列表
	std::list<QuestionMarkEntity> qmList;//问号列表
};

