AccessibilityInfo.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * AccessibilityInfo.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 "BattleHex.h"
  12. #include "../GameConstants.h"
  13. class CStack;
  14. //Accessibility is property of hex in battle. It doesn't depend on stack, side's perspective and so on.
  15. enum class EAccessibility
  16. {
  17. ACCESSIBLE,
  18. ALIVE_STACK,
  19. OBSTACLE,
  20. DESTRUCTIBLE_WALL,
  21. GATE, //sieges -> gate opens only for defender stacks
  22. UNAVAILABLE, //indestructible wall parts, special battlefields (like boat-to-boat)
  23. SIDE_COLUMN //used for first and last columns of hexes that are unavailable but wat machines can stand there
  24. };
  25. typedef std::array<EAccessibility, GameConstants::BFIELD_SIZE> TAccessibilityArray;
  26. struct DLL_LINKAGE AccessibilityInfo : TAccessibilityArray
  27. {
  28. bool accessible(BattleHex tile, const CStack * stack) const; //checks for both tiles if stack is double wide
  29. bool accessible(BattleHex tile, bool doubleWide, ui8 side) const; //checks for both tiles if stack is double wide
  30. };