FF7NameLookup.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. -----------------------------------------------------------------------------
  3. Copyright (c) 15.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
  4. This file is part of Q-Gears
  5. Q-Gears 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, version 2.0 (GPLv2) of the License.
  8. Q-Gears is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. -----------------------------------------------------------------------------
  13. */
  14. #ifndef __FF7NameLookup_H__
  15. #define __FF7NameLookup_H__
  16. #include "common/TypeDefine.h"
  17. namespace QGears
  18. {
  19. namespace FF7
  20. {
  21. class NameLookup
  22. {
  23. public:
  24. NameLookup() = default;
  25. virtual ~NameLookup() = default;
  26. static const String& animation(const String &key)
  27. {
  28. return lookup(key, ms_animations);
  29. }
  30. static const String& model(const String &key)
  31. {
  32. return lookup(key, ms_models);
  33. }
  34. protected:
  35. typedef std::map<const String, const String> LookupMap;
  36. static LookupMap createAnimations()
  37. {
  38. LookupMap lookup;
  39. lookup.insert(LookupMap::value_type("acfe", "Idle"));
  40. lookup.insert(LookupMap::value_type("aaff", "Walk"));
  41. lookup.insert(LookupMap::value_type("aaga", "Run"));
  42. lookup.insert(LookupMap::value_type("bvjf", "JumpFromTrain"));
  43. // barret
  44. lookup.insert(LookupMap::value_type("adcb", "Idle"));
  45. lookup.insert(LookupMap::value_type("adcc", "Walk"));
  46. lookup.insert(LookupMap::value_type("adcd", "Run"));
  47. lookup.insert(LookupMap::value_type("bwaa", "Invitation"));
  48. // sd_red
  49. lookup.insert(LookupMap::value_type("aeae", "Idle"));
  50. lookup.insert(LookupMap::value_type("aeaf", "Walk"));
  51. lookup.insert(LookupMap::value_type("aeba", "Run"));
  52. return lookup;
  53. }
  54. static LookupMap createModels()
  55. {
  56. LookupMap lookup;
  57. lookup.insert(LookupMap::value_type("aaaa", "n_cloud"));
  58. lookup.insert(LookupMap::value_type("adda", "sd_red"));
  59. return lookup;
  60. }
  61. static const String& lookup(const String &key, const LookupMap &data)
  62. {
  63. LookupMap::const_iterator found(data.find(key));
  64. if (found == data.end()) return key;
  65. return found->second;
  66. }
  67. private:
  68. static LookupMap ms_animations;
  69. static LookupMap ms_models;
  70. };
  71. }
  72. }
  73. #endif // __FF7NameLookup_H__