#pragma once
#include <boost/unordered_map.hpp>
#include <vector>
struct M_ExchangeCFGData
{
	//兑换ID
	int mChangeId;
	//所在功能
	int mFunction;
	// 兑换顺序
	int moder;
	//道具名称
	std::string mItemName;
	//物品描述
	std::string mItemDesc;
	//VIP条件
	int mVipCondition;
	//兑换类型
	int mExchangeType;
	//所需道具id
	std::vector<int> mNeedItemId;
	//所花费话费卷数量(单位分)
	std::vector<int> mNeedItemCount;
	//道具ID（与ItemCFG.xld道具ID对应)
	std::vector<int> mItemId;
	//兑换物品数量
	std::vector<int> mItemCount;
	//显示资源ICON
	std::string mIcon;
	//次数类型
	int mTimeType;
	//服务器每日最大可兑换次数，0表示当天不限制
	int mExchangeMaxLimit;
	//类型
	int mType;
	//管理端
	int mManageMent;
	//管理端名称显示
	std::string mManageMentName;
	//显示折扣Discount
	int mDiscount;
	//返还贡献
	int mReturnContribution;
};

class M_ExchangeCFG
{
public:
private:
	static std::auto_ptr<M_ExchangeCFG> msSingleton;
public:
	int GetCount();
	const M_ExchangeCFGData* GetData(int ChangeId);
	boost::unordered_map<int, M_ExchangeCFGData>& GetMapData();
	void Reload();
	void Load(const std::string& path);
	void Load();
	static M_ExchangeCFG* GetSingleton();
private:
	boost::unordered_map<int, M_ExchangeCFGData> mMapData;
};
