AccessibilityInfo.h 1.2 KB

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