RegisterTypes.cpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. template<typename Serializer> DLL_EXPORT
  10. void registerTypes1(Serializer &s)
  11. {
  12. s.template registerType<CGHeroInstance>();
  13. s.template registerType<CGTownInstance>();
  14. s.template registerType<CGEvent>();
  15. s.template registerType<CGVisitableOPH>();
  16. s.template registerType<CGVisitableOPW>();
  17. s.template registerType<CGTeleport>();
  18. s.template registerType<CGPickable>();
  19. s.template registerType<CGCreature>();
  20. s.template registerType<CGSignBottle>();
  21. s.template registerType<CGSeerHut>();
  22. s.template registerType<CGWitchHut>();
  23. s.template registerType<CGScholar>();
  24. s.template registerType<CGGarrison>();
  25. s.template registerType<CGArtifact>();
  26. s.template registerType<CGResource>();
  27. s.template registerType<CGMine>();
  28. s.template registerType<CGShrine>();
  29. s.template registerType<CGPandoraBox>();
  30. s.template registerType<CGQuestGuard>();
  31. s.template registerType<CGBonusingObject>();
  32. s.template registerType<CGMagicWell>();
  33. s.template registerType<CGObservatory>();
  34. s.template registerType<CGObjectInstance>();
  35. }
  36. template<typename Serializer> DLL_EXPORT
  37. void registerTypes2(Serializer &s)
  38. {
  39. s.template registerType<SystemMessage>();
  40. s.template registerType<YourTurn>();
  41. s.template registerType<SetResource>();
  42. s.template registerType<SetResources>();
  43. s.template registerType<SetPrimSkill>();
  44. s.template registerType<SetSecSkill>();
  45. s.template registerType<HeroVisitCastle>();
  46. s.template registerType<ChangeSpells>();
  47. s.template registerType<SetMana>();
  48. s.template registerType<SetMovePoints>();
  49. s.template registerType<FoWChange>();
  50. s.template registerType<SetAvailableHeroes>();
  51. s.template registerType<GiveBonus>();
  52. s.template registerType<ChangeObjPos>();
  53. s.template registerType<RemoveObject>();
  54. s.template registerType<TryMoveHero>();
  55. s.template registerType<SetGarrisons>();
  56. s.template registerType<NewStructures>();
  57. s.template registerType<SetAvailableCreatures>();
  58. s.template registerType<SetHeroesInTown>();
  59. s.template registerType<SetHeroArtifacts>();
  60. s.template registerType<HeroRecruited>();
  61. s.template registerType<GiveHero>();
  62. s.template registerType<NewTurn>();
  63. s.template registerType<InfoWindow>();
  64. s.template registerType<SetObjectProperty>();
  65. s.template registerType<SetHoverName>();
  66. s.template registerType<HeroLevelUp>();
  67. s.template registerType<BlockingDialog>();
  68. s.template registerType<BattleStart>();
  69. s.template registerType<BattleNextRound>();
  70. s.template registerType<BattleSetActiveStack>();
  71. s.template registerType<BattleResult>();
  72. s.template registerType<BattleStackMoved>();
  73. s.template registerType<BattleStackAttacked>();
  74. s.template registerType<BattleAttack>();
  75. s.template registerType<StartAction>();
  76. s.template registerType<EndAction>();
  77. s.template registerType<SpellCasted>();
  78. s.template registerType<SetStackEffect>();
  79. s.template registerType<ShowInInfobox>();
  80. s.template registerType<SaveGame>();
  81. s.template registerType<SetSelection>();
  82. s.template registerType<PlayerMessage>();
  83. }
  84. template<typename Serializer> DLL_EXPORT
  85. void registerTypes3(Serializer &s)
  86. {
  87. s.template registerType<CloseServer>();
  88. s.template registerType<EndTurn>();
  89. s.template registerType<DismissHero>();
  90. s.template registerType<MoveHero>();
  91. s.template registerType<ArrangeStacks>();
  92. s.template registerType<DisbandCreature>();
  93. s.template registerType<BuildStructure>();
  94. s.template registerType<RecruitCreatures>();
  95. s.template registerType<UpgradeCreature>();
  96. s.template registerType<GarrisonHeroSwap>();
  97. s.template registerType<ExchangeArtifacts>();
  98. s.template registerType<BuyArtifact>();
  99. s.template registerType<TradeOnMarketplace>();
  100. s.template registerType<SetFormation>();
  101. s.template registerType<HireHero>();
  102. s.template registerType<QueryReply>();
  103. s.template registerType<MakeAction>();
  104. s.template registerType<MakeCustomAction>();
  105. s.template registerType<SaveGame>();
  106. s.template registerType<SetSelection>();
  107. s.template registerType<PlayerMessage>();
  108. }
  109. template<typename Serializer> DLL_EXPORT
  110. void registerTypes(Serializer &s)
  111. {
  112. registerTypes1(s);
  113. registerTypes2(s);
  114. registerTypes3(s);
  115. }