#pragma once
#include "global.h"
//动画帧
struct AniFrame
{
	int id = 0;//动画pid
	float offx = 0;
	float offy = 0;
};
//动画层
struct AniLayer
{
	std::vector<AniFrame> frameList;
};

//动画属性
struct AniPrep
{
	bool loop = false;
	int speed = 0;
	int texture_up = 16;
	int texture_down = 16;
	int texture_left = 16;
	int texture_right = 16;
	std::vector<AniLayer> layerList;
};
//Pid文件
struct PidData
{
	//图像输出比例
	bool bInterArea = false;
	int pid_tile_w = 16;
	int pid_tile_h = 16;
	std::unordered_map<int, MyRect> pidList;
	std::unordered_map<std::wstring, AniPrep> aniList;
};
//Pid文件载入和读取
class GamePid
{
public:
	PidData* GetPid(const wchar_t* pidName);
	CString* pEntityLanguage = nullptr;
	void ReloadLanguage();//重载语言部分
private:
	std::unordered_map<std::wstring, PidData> loadedPid;//载入的pid数据
	void LoadPid(PidData* outPidData, const wchar_t* pidName);
	void LoadPidXML(PidData* outPidData, const wchar_t* xml);
};

