RegisterTypes.cpp 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. s.template registerType<CGHeroInstance>();
  22. s.template registerType<CGTownInstance>();
  23. s.template registerType<CTownBonus>();
  24. s.template registerType<CGPandoraBox>();
  25. s.template registerType<CGEvent>();
  26. s.template registerType<CGDwelling>();
  27. s.template registerType<CGVisitableOPH>();
  28. s.template registerType<CGVisitableOPW>();
  29. s.template registerType<CGTeleport>();
  30. s.template registerType<CGPickable>();
  31. s.template registerType<CGCreature>();
  32. s.template registerType<CGSignBottle>();
  33. s.template registerType<CGSeerHut>();
  34. s.template registerType<CGWitchHut>();
  35. s.template registerType<CGScholar>();
  36. s.template registerType<CGGarrison>();
  37. s.template registerType<CGArtifact>();
  38. s.template registerType<CGResource>();
  39. s.template registerType<CGMine>();
  40. s.template registerType<CGShrine>();
  41. s.template registerType<CGQuestGuard>();
  42. s.template registerType<CGBonusingObject>();
  43. s.template registerType<CGMagicWell>();
  44. s.template registerType<CGObservatory>();
  45. s.template registerType<CGKeys>();
  46. s.template registerType<CGKeymasterTent>();
  47. s.template registerType<CGBorderGuard>();
  48. s.template registerType<CGBoat>();
  49. s.template registerType<CGMagi>();
  50. s.template registerType<CGSirens>();
  51. s.template registerType<CGOnceVisitable>();
  52. s.template registerType<CBank>();
  53. s.template registerType<CGShipyard>();
  54. s.template registerType<CCartographer>();
  55. s.template registerType<CGObjectInstance>();
  56. }
  57. template<typename Serializer> DLL_EXPORT
  58. void registerTypes2(Serializer &s)
  59. {
  60. s.template registerType<PackageApplied>();
  61. s.template registerType<SystemMessage>();
  62. s.template registerType<PlayerBlocked>();
  63. s.template registerType<YourTurn>();
  64. s.template registerType<SetResource>();
  65. s.template registerType<SetResources>();
  66. s.template registerType<SetPrimSkill>();
  67. s.template registerType<SetSecSkill>();
  68. s.template registerType<HeroVisitCastle>();
  69. s.template registerType<ChangeSpells>();
  70. s.template registerType<SetMana>();
  71. s.template registerType<SetMovePoints>();
  72. s.template registerType<FoWChange>();
  73. s.template registerType<SetAvailableHeroes>();
  74. s.template registerType<GiveBonus>();
  75. s.template registerType<ChangeObjPos>();
  76. s.template registerType<RemoveObject>();
  77. s.template registerType<TryMoveHero>();
  78. s.template registerType<SetGarrisons>();
  79. s.template registerType<NewStructures>();
  80. s.template registerType<RazeStructures>();
  81. s.template registerType<SetAvailableCreatures>();
  82. s.template registerType<SetHeroesInTown>();
  83. s.template registerType<SetHeroArtifacts>();
  84. s.template registerType<HeroRecruited>();
  85. s.template registerType<GiveHero>();
  86. s.template registerType<NewTurn>();
  87. s.template registerType<InfoWindow>();
  88. s.template registerType<SetObjectProperty>();
  89. s.template registerType<SetHoverName>();
  90. s.template registerType<HeroLevelUp>();
  91. s.template registerType<BlockingDialog>();
  92. s.template registerType<GarrisonDialog>();
  93. s.template registerType<BattleStart>();
  94. s.template registerType<BattleNextRound>();
  95. s.template registerType<BattleSetActiveStack>();
  96. s.template registerType<BattleResult>();
  97. s.template registerType<BattleStackMoved>();
  98. s.template registerType<BattleStackAttacked>();
  99. s.template registerType<BattleAttack>();
  100. s.template registerType<StartAction>();
  101. s.template registerType<EndAction>();
  102. s.template registerType<SpellCast>();
  103. s.template registerType<SetStackEffect>();
  104. s.template registerType<StacksInjured>();
  105. s.template registerType<BattleResultsApplied>();
  106. s.template registerType<StacksHealedOrResurrected>();
  107. s.template registerType<ObstaclesRemoved>();
  108. s.template registerType<CatapultAttack>();
  109. s.template registerType<BattleStacksRemoved>();
  110. s.template registerType<ShowInInfobox>();
  111. s.template registerType<OpenWindow>();
  112. s.template registerType<NewObject>();
  113. s.template registerType<SaveGame>();
  114. s.template registerType<SetSelection>();
  115. s.template registerType<PlayerMessage>();
  116. s.template registerType<CenterView>();
  117. }
  118. template<typename Serializer> DLL_EXPORT
  119. void registerTypes3(Serializer &s)
  120. {
  121. s.template registerType<CloseServer>();
  122. s.template registerType<EndTurn>();
  123. s.template registerType<DismissHero>();
  124. s.template registerType<MoveHero>();
  125. s.template registerType<ArrangeStacks>();
  126. s.template registerType<DisbandCreature>();
  127. s.template registerType<BuildStructure>();
  128. s.template registerType<RecruitCreatures>();
  129. s.template registerType<UpgradeCreature>();
  130. s.template registerType<GarrisonHeroSwap>();
  131. s.template registerType<ExchangeArtifacts>();
  132. s.template registerType<BuyArtifact>();
  133. s.template registerType<TradeOnMarketplace>();
  134. s.template registerType<SetFormation>();
  135. s.template registerType<HireHero>();
  136. s.template registerType<BuildBoat>();
  137. s.template registerType<QueryReply>();
  138. s.template registerType<MakeAction>();
  139. s.template registerType<MakeCustomAction>();
  140. s.template registerType<SaveGame>();
  141. s.template registerType<SetSelection>();
  142. s.template registerType<PlayerMessage>();
  143. }
  144. template<typename Serializer> DLL_EXPORT
  145. void registerTypes(Serializer &s)
  146. {
  147. registerTypes1(s);
  148. registerTypes2(s);
  149. registerTypes3(s);
  150. }