#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;//数字的样式
	const int timecounter_max = 180;
	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> numList;//伤害值列表
	std::list<QuestionMarkEntity> qmList;//问号列表
};

