Languages.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef LANGUAGES_H_
  17. #define LANGUAGES_H_
  18. #include <string>
  19. #include <list>
  20. #include "../common/types.h"
  21. using namespace std;
  22. class Language {
  23. public:
  24. Language();
  25. Language(Language* language);
  26. void SetID(int32 id) {this->id = id;}
  27. void SetName(const char *name) {strncpy(this->name, name, sizeof(this->name));}
  28. void SetSaveNeeded(bool save_needed) {this->save_needed = save_needed;}
  29. int32 GetID() {return id;}
  30. const char* GetName() {return name;}
  31. bool GetSaveNeeded() {return save_needed;}
  32. private:
  33. int32 id;
  34. char name[50];
  35. bool save_needed;
  36. };
  37. class MasterLanguagesList {
  38. public:
  39. MasterLanguagesList();
  40. ~MasterLanguagesList();
  41. void Clear();
  42. int32 Size();
  43. void AddLanguage(Language* language);
  44. Language* GetLanguage(int32 id);
  45. Language* GetLanguageByName(const char* name);
  46. list<Language*>* GetAllLanguages();
  47. private:
  48. list<Language*> languages_list;
  49. };
  50. class PlayerLanguagesList {
  51. public:
  52. PlayerLanguagesList();
  53. ~PlayerLanguagesList();
  54. void Add(Language* language);
  55. Language* GetLanguage(int32 id);
  56. Language* GetLanguageByName(const char* name);
  57. list<Language*>* GetAllLanguages();
  58. private:
  59. list<Language*> player_languages_list;
  60. };
  61. #endif