Fish_ChatCFG.h 593 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <boost/unordered_map.hpp>
  3. #include <vector>
  4. struct Fish_ChatCFGData
  5. {
  6. //声音ID
  7. int mID;
  8. //声音名字
  9. std::string mChatInfo;
  10. //持续时间
  11. float mDuration;
  12. //声音ID
  13. int mSoundID;
  14. };
  15. class Fish_ChatCFG
  16. {
  17. public:
  18. private:
  19. static std::auto_ptr<Fish_ChatCFG> msSingleton;
  20. public:
  21. int GetCount();
  22. const Fish_ChatCFGData* GetData(int ID);
  23. boost::unordered_map<int, Fish_ChatCFGData>& GetMapData();
  24. void Reload();
  25. void Load(const std::string& path);
  26. void Load();
  27. static Fish_ChatCFG* GetSingleton();
  28. private:
  29. boost::unordered_map<int, Fish_ChatCFGData> mMapData;
  30. };