RoadPlacer.h 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * RoadPlacer.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. VCMI_LIB_NAMESPACE_BEGIN
  13. class RoadPlacer: public Modificator
  14. {
  15. public:
  16. MODIFICATOR(RoadPlacer);
  17. void process() override;
  18. char dump(const int3 &) override;
  19. void addRoadNode(const int3 & node);
  20. void connectRoads(); //fills "roads" according to "roadNodes"
  21. rmg::Area & areaForRoads();
  22. rmg::Area & areaIsolated();
  23. const rmg::Area & getRoads() const;
  24. protected:
  25. bool createRoad(const int3 & dst);
  26. void drawRoads(bool secondary = false); //actually updates tiles
  27. protected:
  28. rmg::Tileset roadNodes; //tiles to be connected with roads
  29. rmg::Area roads; //all tiles with roads
  30. rmg::Area areaRoads, isolated;
  31. };
  32. VCMI_LIB_NAMESPACE_END