2
0

RegisterTypes.cpp 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. #include "Connection.h"
  2. #include "NetPacks.h"
  3. #include "VCMI_Lib.h"
  4. #include "CArtHandler.h"
  5. #include "CObjectHandler.h"
  6. #include "CGameState.h"
  7. #include "CHeroHandler.h"
  8. #include "CTownHandler.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. #ifndef VCMI_DLL
  19. #undef DLL_EXPORT
  20. #define DLL_EXPORT
  21. #endif
  22. #include "RegisterTypes.h"
  23. template<typename Serializer> DLL_EXPORT
  24. void registerTypes1(Serializer &s)
  25. {
  26. //map objects
  27. s.template registerType<CGHeroPlaceholder>();
  28. s.template registerType<CGHeroInstance>();
  29. s.template registerType<CGTownInstance>();
  30. s.template registerType<CTownBonus>();
  31. s.template registerType<CGPandoraBox>();
  32. s.template registerType<CGEvent>();
  33. s.template registerType<CGDwelling>();
  34. s.template registerType<CGVisitableOPH>();
  35. s.template registerType<CGVisitableOPW>();
  36. s.template registerType<CGTeleport>();
  37. s.template registerType<CGPickable>();
  38. s.template registerType<CGCreature>();
  39. s.template registerType<CGSignBottle>();
  40. s.template registerType<CGSeerHut>();
  41. s.template registerType<CGQuestGuard>();
  42. s.template registerType<CGWitchHut>();
  43. s.template registerType<CGScholar>();
  44. s.template registerType<CGGarrison>();
  45. s.template registerType<CGArtifact>();
  46. s.template registerType<CGResource>();
  47. s.template registerType<CGMine>();
  48. s.template registerType<CGShrine>();
  49. s.template registerType<CGBonusingObject>();
  50. s.template registerType<CGMagicSpring>();
  51. s.template registerType<CGMagicWell>();
  52. s.template registerType<CGObservatory>();
  53. s.template registerType<CGKeys>();
  54. s.template registerType<CGKeymasterTent>();
  55. s.template registerType<CGBorderGuard>();
  56. s.template registerType<CGBoat>();
  57. s.template registerType<CGMagi>();
  58. s.template registerType<CGSirens>();
  59. s.template registerType<CGOnceVisitable>();
  60. s.template registerType<CBank>();
  61. s.template registerType<CGPyramid>();
  62. s.template registerType<CGShipyard>();
  63. s.template registerType<CCartographer>();
  64. s.template registerType<CGObjectInstance>();
  65. s.template registerType<COPWBonus>();
  66. s.template registerType<CGDenOfthieves>();
  67. s.template registerType<CGObelisk>();
  68. s.template registerType<CGLighthouse>();
  69. s.template registerType<CGMarket>();
  70. s.template registerType<CGBlackMarket>();
  71. s.template registerType<CGUniversity>();
  72. //end of objects
  73. s.template registerType<ILimiter>();
  74. s.template registerType<CCreatureTypeLimiter>();
  75. s.template registerType<HasAnotherBonusLimiter>();
  76. s.template registerType<CreatureNativeTerrainLimiter>();
  77. s.template registerType<CreatureFactionLimiter>();
  78. s.template registerType<CreatureAlignmentLimiter>();
  79. s.template registerType<CBonusSystemNode>();
  80. s.template registerType<CArtifact>();
  81. s.template registerType<CCreature>();
  82. s.template registerType<CStackInstance>();
  83. s.template registerType<PlayerState>();
  84. s.template registerType<TeamState>();
  85. s.template registerType<CGameState>();
  86. s.template registerType<CGHeroInstance::HeroSpecial>();
  87. s.template registerType<CArmedInstance>();
  88. s.template registerType<CStack>();
  89. s.template registerType<BattleInfo>();
  90. s.template registerType<CArtifactInstance>();
  91. s.template registerType<CCombinedArtifactInstance>();
  92. }
  93. template<typename Serializer> DLL_EXPORT
  94. void registerTypes2(Serializer &s)
  95. {
  96. s.template registerType<PackageApplied>();
  97. s.template registerType<SystemMessage>();
  98. s.template registerType<PlayerBlocked>();
  99. s.template registerType<YourTurn>();
  100. s.template registerType<SetResource>();
  101. s.template registerType<SetResources>();
  102. s.template registerType<SetPrimSkill>();
  103. s.template registerType<SetSecSkill>();
  104. s.template registerType<HeroVisitCastle>();
  105. s.template registerType<ChangeSpells>();
  106. s.template registerType<SetMana>();
  107. s.template registerType<SetMovePoints>();
  108. s.template registerType<FoWChange>();
  109. s.template registerType<SetAvailableHeroes>();
  110. s.template registerType<GiveBonus>();
  111. s.template registerType<ChangeObjPos>();
  112. s.template registerType<PlayerEndsGame>();
  113. s.template registerType<RemoveBonus>();
  114. s.template registerType<UpdateCampaignState>();
  115. s.template registerType<RemoveObject>();
  116. s.template registerType<TryMoveHero>();
  117. //s.template registerType<SetGarrisons>();
  118. s.template registerType<NewStructures>();
  119. s.template registerType<RazeStructures>();
  120. s.template registerType<SetAvailableCreatures>();
  121. s.template registerType<SetHeroesInTown>();
  122. //s.template registerType<SetHeroArtifacts>();
  123. s.template registerType<HeroRecruited>();
  124. s.template registerType<GiveHero>();
  125. s.template registerType<NewTurn>();
  126. s.template registerType<InfoWindow>();
  127. s.template registerType<SetObjectProperty>();
  128. s.template registerType<SetHoverName>();
  129. s.template registerType<HeroLevelUp>();
  130. s.template registerType<BlockingDialog>();
  131. s.template registerType<GarrisonDialog>();
  132. s.template registerType<BattleStart>();
  133. s.template registerType<BattleNextRound>();
  134. s.template registerType<BattleSetActiveStack>();
  135. s.template registerType<BattleResult>();
  136. s.template registerType<BattleStackMoved>();
  137. s.template registerType<BattleStackAttacked>();
  138. s.template registerType<BattleAttack>();
  139. s.template registerType<StartAction>();
  140. s.template registerType<EndAction>();
  141. s.template registerType<BattleSpellCast>();
  142. s.template registerType<SetStackEffect>();
  143. s.template registerType<StacksInjured>();
  144. s.template registerType<BattleResultsApplied>();
  145. s.template registerType<StacksHealedOrResurrected>();
  146. s.template registerType<ObstaclesRemoved>();
  147. s.template registerType<CatapultAttack>();
  148. s.template registerType<BattleStacksRemoved>();
  149. s.template registerType<ShowInInfobox>();
  150. s.template registerType<AdvmapSpellCast>();
  151. s.template registerType<OpenWindow>();
  152. s.template registerType<NewObject>();
  153. s.template registerType<NewArtifact>();
  154. s.template registerType<ChangeStackCount>();
  155. s.template registerType<SetStackType>();
  156. s.template registerType<EraseStack>();
  157. s.template registerType<SwapStacks>();
  158. s.template registerType<InsertNewStack>();
  159. s.template registerType<RebalanceStacks>();
  160. s.template registerType<SetAvailableArtifacts>();
  161. s.template registerType<PutArtifact>();
  162. s.template registerType<EraseArtifact>();
  163. s.template registerType<MoveArtifact>();
  164. s.template registerType<AssembledArtifact>();
  165. s.template registerType<DisassembledArtifact>();
  166. s.template registerType<SaveGame>();
  167. s.template registerType<SetSelection>();
  168. s.template registerType<PlayerMessage>();
  169. s.template registerType<CenterView>();
  170. }
  171. template<typename Serializer> DLL_EXPORT
  172. void registerTypes3(Serializer &s)
  173. {
  174. s.template registerType<CloseServer>();
  175. s.template registerType<EndTurn>();
  176. s.template registerType<DismissHero>();
  177. s.template registerType<MoveHero>();
  178. s.template registerType<ArrangeStacks>();
  179. s.template registerType<DisbandCreature>();
  180. s.template registerType<BuildStructure>();
  181. s.template registerType<RecruitCreatures>();
  182. s.template registerType<UpgradeCreature>();
  183. s.template registerType<GarrisonHeroSwap>();
  184. s.template registerType<ExchangeArtifacts>();
  185. s.template registerType<AssembleArtifacts>();
  186. s.template registerType<BuyArtifact>();
  187. s.template registerType<TradeOnMarketplace>();
  188. s.template registerType<SetFormation>();
  189. s.template registerType<HireHero>();
  190. s.template registerType<BuildBoat>();
  191. s.template registerType<QueryReply>();
  192. s.template registerType<MakeAction>();
  193. s.template registerType<MakeCustomAction>();
  194. s.template registerType<DigWithHero>();
  195. s.template registerType<CastAdvSpell>();
  196. s.template registerType<CastleTeleportHero>();
  197. s.template registerType<SaveGame>();
  198. s.template registerType<SetSelection>();
  199. s.template registerType<PlayerMessage>();
  200. }
  201. template<typename Serializer> DLL_EXPORT
  202. void registerTypes4(Serializer &s)
  203. {
  204. s.template registerType<ChatMessage>();
  205. s.template registerType<QuitMenuWithoutStarting>();
  206. s.template registerType<PlayerJoined>();
  207. s.template registerType<SelectMap>();
  208. s.template registerType<UpdateStartOptions>();
  209. s.template registerType<PregameGuiAction>();
  210. s.template registerType<RequestOptionsChange>();
  211. s.template registerType<PlayerLeft>();
  212. s.template registerType<PlayersNames>();
  213. s.template registerType<StartWithCurrentSettings>();
  214. }
  215. template<typename Serializer> DLL_EXPORT
  216. void registerTypes(Serializer &s)
  217. {
  218. registerTypes1(s);
  219. registerTypes2(s);
  220. registerTypes3(s);
  221. registerTypes4(s);
  222. }