M_ActivityTaskCFG.h 790 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_ActivityTaskCFGData
  5. {
  6. //任务ID
  7. int mID;
  8. //描述1
  9. std::string mDesc1;
  10. //描述2
  11. std::string mDesc2;
  12. //完成条件类型
  13. int mCompleteType;
  14. //完成计数
  15. std::vector<int> mCompleteCount;
  16. //奖励物品
  17. std::vector<int> mAwardItem;
  18. //特殊参数,填0不生效。对任务捕获指定鱼需要填写
  19. int mCompleteParam;
  20. };
  21. class M_ActivityTaskCFG
  22. {
  23. public:
  24. private:
  25. static std::auto_ptr<M_ActivityTaskCFG> msSingleton;
  26. public:
  27. int GetCount();
  28. const M_ActivityTaskCFGData* GetData(int ID);
  29. boost::unordered_map<int, M_ActivityTaskCFGData>& GetMapData();
  30. void Reload();
  31. void Load(const std::string& path);
  32. void Load();
  33. static M_ActivityTaskCFG* GetSingleton();
  34. private:
  35. boost::unordered_map<int, M_ActivityTaskCFGData> mMapData;
  36. };