RegisterTypes.cpp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. #define VCMI_DLL
  2. #include "Connection.h"
  3. #include "NetPacks.h"
  4. #include "VCMI_Lib.h"
  5. #include "../hch/CObjectHandler.h"
  6. #include "../hch/CHeroHandler.h"
  7. #include "../hch/CTownHandler.h"
  8. #include "RegisterTypes.h"
  9. /*
  10. * RegisterTypes.cpp, part of VCMI engine
  11. *
  12. * Authors: listed in file AUTHORS in main folder
  13. *
  14. * License: GNU General Public License v2.0 or later
  15. * Full text of license available in license.txt file, in main folder
  16. *
  17. */
  18. template<typename Serializer> DLL_EXPORT
  19. void registerTypes1(Serializer &s)
  20. {
  21. //map objects
  22. s.template registerType<CGHeroPlaceholder>();
  23. s.template registerType<CGHeroInstance>();
  24. s.template registerType<CGTownInstance>();
  25. s.template registerType<CTownBonus>();
  26. s.template registerType<CGPandoraBox>();
  27. s.template registerType<CGEvent>();
  28. s.template registerType<CGDwelling>();
  29. s.template registerType<CGVisitableOPH>();
  30. s.template registerType<CGVisitableOPW>();
  31. s.template registerType<CGTeleport>();
  32. s.template registerType<CGPickable>();
  33. s.template registerType<CGCreature>();
  34. s.template registerType<CGSignBottle>();
  35. s.template registerType<CGSeerHut>();
  36. s.template registerType<CGQuestGuard>();
  37. s.template registerType<CGWitchHut>();
  38. s.template registerType<CGScholar>();
  39. s.template registerType<CGGarrison>();
  40. s.template registerType<CGArtifact>();
  41. s.template registerType<CGResource>();
  42. s.template registerType<CGMine>();
  43. s.template registerType<CGShrine>();
  44. s.template registerType<CGBonusingObject>();
  45. s.template registerType<CGMagicSpring>();
  46. s.template registerType<CGMagicWell>();
  47. s.template registerType<CGObservatory>();
  48. s.template registerType<CGKeys>();
  49. s.template registerType<CGKeymasterTent>();
  50. s.template registerType<CGBorderGuard>();
  51. s.template registerType<CGBoat>();
  52. s.template registerType<CGMagi>();
  53. s.template registerType<CGSirens>();
  54. s.template registerType<CGOnceVisitable>();
  55. s.template registerType<CBank>();
  56. s.template registerType<CGPyramid>();
  57. s.template registerType<CGShipyard>();
  58. s.template registerType<CCartographer>();
  59. s.template registerType<CGObjectInstance>();
  60. s.template registerType<COPWBonus>();
  61. s.template registerType<CGDenOfthieves>();
  62. s.template registerType<CGObelisk>();
  63. s.template registerType<CGLighthouse>();
  64. s.template registerType<CGMarket>();
  65. s.template registerType<CGBlackMarket>();
  66. s.template registerType<CGUniversity>();
  67. //end of objects
  68. s.template registerType<ILimiter>();
  69. s.template registerType<CCreatureTypeLimiter>();
  70. }
  71. template<typename Serializer> DLL_EXPORT
  72. void registerTypes2(Serializer &s)
  73. {
  74. s.template registerType<PackageApplied>();
  75. s.template registerType<SystemMessage>();
  76. s.template registerType<PlayerBlocked>();
  77. s.template registerType<YourTurn>();
  78. s.template registerType<SetResource>();
  79. s.template registerType<SetResources>();
  80. s.template registerType<SetPrimSkill>();
  81. s.template registerType<SetSecSkill>();
  82. s.template registerType<HeroVisitCastle>();
  83. s.template registerType<ChangeSpells>();
  84. s.template registerType<SetMana>();
  85. s.template registerType<SetMovePoints>();
  86. s.template registerType<FoWChange>();
  87. s.template registerType<SetAvailableHeroes>();
  88. s.template registerType<GiveBonus>();
  89. s.template registerType<ChangeObjPos>();
  90. s.template registerType<PlayerEndsGame>();
  91. s.template registerType<RemoveBonus>();
  92. s.template registerType<RemoveObject>();
  93. s.template registerType<TryMoveHero>();
  94. s.template registerType<SetGarrisons>();
  95. s.template registerType<NewStructures>();
  96. s.template registerType<RazeStructures>();
  97. s.template registerType<SetAvailableCreatures>();
  98. s.template registerType<SetHeroesInTown>();
  99. s.template registerType<SetHeroArtifacts>();
  100. s.template registerType<HeroRecruited>();
  101. s.template registerType<GiveHero>();
  102. s.template registerType<NewTurn>();
  103. s.template registerType<InfoWindow>();
  104. s.template registerType<SetObjectProperty>();
  105. s.template registerType<SetHoverName>();
  106. s.template registerType<HeroLevelUp>();
  107. s.template registerType<BlockingDialog>();
  108. s.template registerType<GarrisonDialog>();
  109. s.template registerType<BattleStart>();
  110. s.template registerType<BattleNextRound>();
  111. s.template registerType<BattleSetActiveStack>();
  112. s.template registerType<BattleResult>();
  113. s.template registerType<BattleStackMoved>();
  114. s.template registerType<BattleStackAttacked>();
  115. s.template registerType<BattleAttack>();
  116. s.template registerType<StartAction>();
  117. s.template registerType<EndAction>();
  118. s.template registerType<BattleSpellCast>();
  119. s.template registerType<SetStackEffect>();
  120. s.template registerType<StacksInjured>();
  121. s.template registerType<BattleResultsApplied>();
  122. s.template registerType<StacksHealedOrResurrected>();
  123. s.template registerType<ObstaclesRemoved>();
  124. s.template registerType<CatapultAttack>();
  125. s.template registerType<BattleStacksRemoved>();
  126. s.template registerType<ShowInInfobox>();
  127. s.template registerType<AdvmapSpellCast>();
  128. s.template registerType<OpenWindow>();
  129. s.template registerType<NewObject>();
  130. s.template registerType<SetAvailableArtifacts>();
  131. s.template registerType<SaveGame>();
  132. s.template registerType<SetSelection>();
  133. s.template registerType<PlayerMessage>();
  134. s.template registerType<CenterView>();
  135. }
  136. template<typename Serializer> DLL_EXPORT
  137. void registerTypes3(Serializer &s)
  138. {
  139. s.template registerType<CloseServer>();
  140. s.template registerType<EndTurn>();
  141. s.template registerType<DismissHero>();
  142. s.template registerType<MoveHero>();
  143. s.template registerType<ArrangeStacks>();
  144. s.template registerType<DisbandCreature>();
  145. s.template registerType<BuildStructure>();
  146. s.template registerType<RecruitCreatures>();
  147. s.template registerType<UpgradeCreature>();
  148. s.template registerType<GarrisonHeroSwap>();
  149. s.template registerType<ExchangeArtifacts>();
  150. s.template registerType<AssembleArtifacts>();
  151. s.template registerType<BuyArtifact>();
  152. s.template registerType<TradeOnMarketplace>();
  153. s.template registerType<SetFormation>();
  154. s.template registerType<HireHero>();
  155. s.template registerType<BuildBoat>();
  156. s.template registerType<QueryReply>();
  157. s.template registerType<MakeAction>();
  158. s.template registerType<MakeCustomAction>();
  159. s.template registerType<DigWithHero>();
  160. s.template registerType<CastAdvSpell>();
  161. s.template registerType<CastleTeleportHero>();
  162. s.template registerType<SaveGame>();
  163. s.template registerType<SetSelection>();
  164. s.template registerType<PlayerMessage>();
  165. }
  166. template<typename Serializer> DLL_EXPORT
  167. void registerTypes(Serializer &s)
  168. {
  169. registerTypes1(s);
  170. registerTypes2(s);
  171. registerTypes3(s);
  172. }