ConnectionsPlacer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 selfSideDirectConnection(const rmg::ZoneConnection & connection);
  22. void selfSideIndirectConnection(const rmg::ZoneConnection & connection);
  23. void otherSideConnection(const rmg::ZoneConnection & connection);
  24. void createBorder();
  25. bool shouldGenerateRoad(const rmg::ZoneConnection& connection) const;
  26. protected:
  27. void collectNeighbourZones();
  28. std::pair<Zone::Lock, Zone::Lock> lockZones(std::shared_ptr<Zone> otherZone);
  29. protected:
  30. std::vector<rmg::ZoneConnection> dConnections;
  31. std::vector<rmg::ZoneConnection> dCompleted;
  32. std::map<TRmgTemplateZoneId, rmg::Tileset> dNeighbourZones;
  33. };
  34. VCMI_LIB_NAMESPACE_END