RegisterTypes.cpp 6.8 KB

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