M_Notice.h 656 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_NoticeData
  5. {
  6. //key
  7. int mID;
  8. //图片
  9. std::string mIcon;
  10. //标题
  11. std::string mName;
  12. //内容
  13. std::string mContent;
  14. //显示排序
  15. int mIndex;
  16. //开始时间
  17. std::string mStartTime;
  18. //结束时间
  19. std::string mEndTime;
  20. };
  21. class M_Notice
  22. {
  23. public:
  24. private:
  25. static std::auto_ptr<M_Notice> msSingleton;
  26. public:
  27. int GetCount();
  28. const M_NoticeData* GetData(int ID);
  29. boost::unordered_map<int, M_NoticeData>& GetMapData();
  30. void Reload();
  31. void Load(const std::string& path);
  32. void Load();
  33. static M_Notice* GetSingleton();
  34. private:
  35. boost::unordered_map<int, M_NoticeData> mMapData;
  36. };