CCastleEvent.h 744 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * CCastleEvent.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CMapEvent.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. /// The castle event builds/adds buildings/creatures for a specific town.
  14. class DLL_LINKAGE CCastleEvent : public CMapEvent
  15. {
  16. public:
  17. CCastleEvent() = default;
  18. std::set<BuildingID> buildings;
  19. std::vector<si32> creatures;
  20. template<typename Handler>
  21. void serialize(Handler & h)
  22. {
  23. h & static_cast<CMapEvent &>(*this);
  24. h & buildings;
  25. h & creatures;
  26. }
  27. void serializeJson(JsonSerializeFormat & handler) override;
  28. };
  29. VCMI_LIB_NAMESPACE_END