RoadPlacer.h 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. void init() override;
  19. char dump(const int3 &) override;
  20. void addRoadNode(const int3 & node);
  21. void connectRoads(); //fills "roads" according to "roadNodes"
  22. rmg::Area & areaForRoads();
  23. rmg::Area & areaIsolated();
  24. const rmg::Area & getRoads() const;
  25. protected:
  26. bool createRoad(const int3 & dst);
  27. void drawRoads(bool secondary = false); //actually updates tiles
  28. protected:
  29. rmg::Tileset roadNodes; //tiles to be connected with roads
  30. rmg::Area roads; //all tiles with roads
  31. rmg::Area areaRoads;
  32. rmg::Area isolated;
  33. };
  34. VCMI_LIB_NAMESPACE_END