RegisterTypes.cpp 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. #include "Connection.h"
  2. #include "NetPacks.h"
  3. #include "VCMI_Lib.h"
  4. #include "CObjectHandler.h"
  5. #include "CHeroHandler.h"
  6. #include "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. s.template registerType<HasAnotherBonusLimiter>();
  74. s.template registerType<CreatureNativeTerrainLimiter>();
  75. s.template registerType<CreatureFactionLimiter>();
  76. s.template registerType<CreatureAlignmentLimiter>();
  77. }
  78. template<typename Serializer> DLL_EXPORT
  79. void registerTypes2(Serializer &s)
  80. {
  81. s.template registerType<PackageApplied>();
  82. s.template registerType<SystemMessage>();
  83. s.template registerType<PlayerBlocked>();
  84. s.template registerType<YourTurn>();
  85. s.template registerType<SetResource>();
  86. s.template registerType<SetResources>();
  87. s.template registerType<SetPrimSkill>();
  88. s.template registerType<SetSecSkill>();
  89. s.template registerType<HeroVisitCastle>();
  90. s.template registerType<ChangeSpells>();
  91. s.template registerType<SetMana>();
  92. s.template registerType<SetMovePoints>();
  93. s.template registerType<FoWChange>();
  94. s.template registerType<SetAvailableHeroes>();
  95. s.template registerType<GiveBonus>();
  96. s.template registerType<ChangeObjPos>();
  97. s.template registerType<PlayerEndsGame>();
  98. s.template registerType<RemoveBonus>();
  99. s.template registerType<UpdateCampaignState>();
  100. s.template registerType<RemoveObject>();
  101. s.template registerType<TryMoveHero>();
  102. //s.template registerType<SetGarrisons>();
  103. s.template registerType<NewStructures>();
  104. s.template registerType<RazeStructures>();
  105. s.template registerType<SetAvailableCreatures>();
  106. s.template registerType<SetHeroesInTown>();
  107. s.template registerType<SetHeroArtifacts>();
  108. s.template registerType<HeroRecruited>();
  109. s.template registerType<GiveHero>();
  110. s.template registerType<NewTurn>();
  111. s.template registerType<InfoWindow>();
  112. s.template registerType<SetObjectProperty>();
  113. s.template registerType<SetHoverName>();
  114. s.template registerType<HeroLevelUp>();
  115. s.template registerType<BlockingDialog>();
  116. s.template registerType<GarrisonDialog>();
  117. s.template registerType<BattleStart>();
  118. s.template registerType<BattleNextRound>();
  119. s.template registerType<BattleSetActiveStack>();
  120. s.template registerType<BattleResult>();
  121. s.template registerType<BattleStackMoved>();
  122. s.template registerType<BattleStackAttacked>();
  123. s.template registerType<BattleAttack>();
  124. s.template registerType<StartAction>();
  125. s.template registerType<EndAction>();
  126. s.template registerType<BattleSpellCast>();
  127. s.template registerType<SetStackEffect>();
  128. s.template registerType<StacksInjured>();
  129. s.template registerType<BattleResultsApplied>();
  130. s.template registerType<StacksHealedOrResurrected>();
  131. s.template registerType<ObstaclesRemoved>();
  132. s.template registerType<CatapultAttack>();
  133. s.template registerType<BattleStacksRemoved>();
  134. s.template registerType<ShowInInfobox>();
  135. s.template registerType<AdvmapSpellCast>();
  136. s.template registerType<OpenWindow>();
  137. s.template registerType<NewObject>();
  138. s.template registerType<NewArtifact>();
  139. s.template registerType<ChangeStackCount>();
  140. s.template registerType<SetStackType>();
  141. s.template registerType<EraseStack>();
  142. s.template registerType<SwapStacks>();
  143. s.template registerType<InsertNewStack>();
  144. s.template registerType<RebalanceStacks>();
  145. s.template registerType<SetAvailableArtifacts>();
  146. s.template registerType<PutArtifact>();
  147. s.template registerType<EraseArtifact>();
  148. s.template registerType<MoveArtifact>();
  149. s.template registerType<SaveGame>();
  150. s.template registerType<SetSelection>();
  151. s.template registerType<PlayerMessage>();
  152. s.template registerType<CenterView>();
  153. }
  154. template<typename Serializer> DLL_EXPORT
  155. void registerTypes3(Serializer &s)
  156. {
  157. s.template registerType<CloseServer>();
  158. s.template registerType<EndTurn>();
  159. s.template registerType<DismissHero>();
  160. s.template registerType<MoveHero>();
  161. s.template registerType<ArrangeStacks>();
  162. s.template registerType<DisbandCreature>();
  163. s.template registerType<BuildStructure>();
  164. s.template registerType<RecruitCreatures>();
  165. s.template registerType<UpgradeCreature>();
  166. s.template registerType<GarrisonHeroSwap>();
  167. s.template registerType<ExchangeArtifacts>();
  168. s.template registerType<AssembleArtifacts>();
  169. s.template registerType<BuyArtifact>();
  170. s.template registerType<TradeOnMarketplace>();
  171. s.template registerType<SetFormation>();
  172. s.template registerType<HireHero>();
  173. s.template registerType<BuildBoat>();
  174. s.template registerType<QueryReply>();
  175. s.template registerType<MakeAction>();
  176. s.template registerType<MakeCustomAction>();
  177. s.template registerType<DigWithHero>();
  178. s.template registerType<CastAdvSpell>();
  179. s.template registerType<CastleTeleportHero>();
  180. s.template registerType<SaveGame>();
  181. s.template registerType<SetSelection>();
  182. s.template registerType<PlayerMessage>();
  183. }
  184. template<typename Serializer> DLL_EXPORT
  185. void registerTypes4(Serializer &s)
  186. {
  187. s.template registerType<ChatMessage>();
  188. s.template registerType<QuitMenuWithoutStarting>();
  189. s.template registerType<PlayerJoined>();
  190. s.template registerType<SelectMap>();
  191. s.template registerType<UpdateStartOptions>();
  192. s.template registerType<PregameGuiAction>();
  193. s.template registerType<RequestOptionsChange>();
  194. s.template registerType<PlayerLeft>();
  195. s.template registerType<PlayersNames>();
  196. s.template registerType<StartWithCurrentSettings>();
  197. }
  198. template<typename Serializer> DLL_EXPORT
  199. void registerTypes(Serializer &s)
  200. {
  201. registerTypes1(s);
  202. registerTypes2(s);
  203. registerTypes3(s);
  204. registerTypes4(s);
  205. }