ConnectionsPlacer.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * ConnectionsPlacer.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 "../Zone.h"
  12. #include "../RmgArea.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class ConnectionsPlacer: public Modificator
  15. {
  16. public:
  17. MODIFICATOR(ConnectionsPlacer);
  18. void process() override;
  19. void init() override;
  20. void addConnection(const rmg::ZoneConnection& connection);
  21. void placeMonolithConnection(const rmg::ZoneConnection& connection);
  22. void forcePortalConnection(const rmg::ZoneConnection & connection);
  23. void selfSideDirectConnection(const rmg::ZoneConnection & connection);
  24. void selfSideIndirectConnection(const rmg::ZoneConnection & connection);
  25. void otherSideConnection(const rmg::ZoneConnection & connection);
  26. void createBorder();
  27. bool shouldGenerateRoad(const rmg::ZoneConnection& connection) const;
  28. protected:
  29. void collectNeighbourZones();
  30. std::pair<Zone::Lock, Zone::Lock> lockZones(std::shared_ptr<Zone> otherZone);
  31. protected:
  32. std::vector<rmg::ZoneConnection> dConnections;
  33. std::vector<rmg::ZoneConnection> dCompleted;
  34. std::map<TRmgTemplateZoneId, rmg::Tileset> dNeighbourZones;
  35. };
  36. VCMI_LIB_NAMESPACE_END