M_ChatWord.h 526 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct M_ChatWordData
  5. {
  6. //˳ÐòID
  7. int mWordId;
  8. //³£ÓÃÓï
  9. std::string mText;
  10. };
  11. class M_ChatWord
  12. {
  13. public:
  14. private:
  15. static std::auto_ptr<M_ChatWord> msSingleton;
  16. public:
  17. int GetCount();
  18. const M_ChatWordData* GetData(int WordId);
  19. boost::unordered_map<int, M_ChatWordData>& GetMapData();
  20. void Reload();
  21. void Load(const std::string& path);
  22. void Load();
  23. static M_ChatWord* GetSingleton();
  24. private:
  25. boost::unordered_map<int, M_ChatWordData> mMapData;
  26. };