FF7Character.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #include "common/TypeDefine.h"
  16. /**
  17. * A playable character.
  18. */
  19. class Character{
  20. public:
  21. /**
  22. * Constructor.
  23. */
  24. Character();
  25. /**
  26. * Destructor.
  27. */
  28. virtual ~Character();
  29. /**
  30. * List of character IDs.
  31. */
  32. enum CharacterId{
  33. /**
  34. * Cloud's ID.
  35. */
  36. CLOUD = 0,
  37. /**
  38. * Tifa's ID.
  39. */
  40. TIFA = 1,
  41. /**
  42. * Aerith's ID.
  43. */
  44. AERIS = 2,
  45. /**
  46. * Barret's ID.
  47. */
  48. BARRET = 3,
  49. /**
  50. * Red XIII's ID.
  51. */
  52. RED = 4,
  53. /**
  54. * Cid's ID.
  55. */
  56. CID = 5,
  57. /**
  58. * Vincent's ID.
  59. */
  60. VINCENT = 6,
  61. /**
  62. * Yuffie's ID.
  63. */
  64. YUVI = 7,
  65. /**
  66. * Cait Sith's ID.
  67. */
  68. KETCY = 8,
  69. /**
  70. * Unknown character ID.
  71. */
  72. UNKNOWN = 9
  73. };
  74. /**
  75. * Retrieves a character ID from it's name.
  76. *
  77. * @param[in] name Chaarcter name.
  78. * @return ID of the character with the specified name, or {@see
  79. * UNKNOWN} if the character doesn't exist.
  80. */
  81. static CharacterId GetIdByName( const VGears::String& name);
  82. private:
  83. typedef std::map<VGears::String, CharacterId> CharacterIdLookupMap;
  84. /**
  85. * Creates a lookup map for character names.
  86. *
  87. * Names frequently used in the field scripts for the playable
  88. * characters are included in the lookup map.
  89. *
  90. * @return The character name lookup map.
  91. */
  92. static CharacterIdLookupMap CreateLookupMap();
  93. static const CharacterIdLookupMap character_id_lookup_;
  94. };