mock_battle_Unit.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * mock_battle_Unit.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 "../../lib/battle/Unit.h"
  12. class UnitMock : public battle::Unit
  13. {
  14. public:
  15. MOCK_CONST_METHOD2(getAllBonuses, TConstBonusListPtr(const CSelector &, const std::string &));
  16. MOCK_CONST_METHOD0(getTreeVersion, int32_t());
  17. MOCK_CONST_METHOD0(getCasterUnitId, int32_t());
  18. MOCK_CONST_METHOD2(getSpellSchoolLevel, int32_t(const spells::Spell *, SpellSchool *));
  19. MOCK_CONST_METHOD1(getEffectLevel, int32_t(const spells::Spell *));
  20. MOCK_CONST_METHOD3(getSpellBonus, int64_t(const spells::Spell *, int64_t, const battle::Unit *));
  21. MOCK_CONST_METHOD2(getSpecificSpellBonus, int64_t(const spells::Spell *, int64_t));
  22. MOCK_CONST_METHOD1(getEffectPower, int32_t(const spells::Spell *));
  23. MOCK_CONST_METHOD1(getEnchantPower, int32_t(const spells::Spell *));
  24. MOCK_CONST_METHOD1(getEffectValue, int64_t(const spells::Spell *));
  25. MOCK_CONST_METHOD1(getEffectRange, int64_t(const spells::Spell *));
  26. MOCK_CONST_METHOD0(getCasterOwner, PlayerColor());
  27. MOCK_CONST_METHOD1(getCasterName, void(MetaString &));
  28. MOCK_CONST_METHOD3(getCastDescription, void(const spells::Spell *, const battle::Units &, MetaString &));
  29. MOCK_CONST_METHOD2(spendMana, void(ServerCallback *, const int32_t));
  30. MOCK_CONST_METHOD0(manaLimit, int32_t());
  31. MOCK_CONST_METHOD0(getHeroCaster, CGHeroInstance*());
  32. //ACreature
  33. MOCK_CONST_METHOD0(magicResistance, int32_t());
  34. MOCK_CONST_METHOD0(unitBaseAmount, int32_t());
  35. MOCK_CONST_METHOD0(unitId, uint32_t());
  36. MOCK_CONST_METHOD0(unitSide, BattleSide());
  37. MOCK_CONST_METHOD0(unitOwner, PlayerColor());
  38. MOCK_CONST_METHOD0(unitSlot, SlotID());
  39. MOCK_CONST_METHOD0(unitType, const CCreature * ());
  40. MOCK_CONST_METHOD0(doubleWide, bool());
  41. MOCK_CONST_METHOD0(creatureIndex, int32_t());
  42. MOCK_CONST_METHOD0(creatureId, CreatureID());
  43. MOCK_CONST_METHOD0(creatureLevel, int32_t());
  44. MOCK_CONST_METHOD0(creatureCost, int32_t());
  45. MOCK_CONST_METHOD0(creatureIconIndex, int32_t());
  46. MOCK_CONST_METHOD0(ableToRetaliate, bool());
  47. MOCK_CONST_METHOD0(alive, bool());
  48. MOCK_CONST_METHOD0(isGhost, bool());
  49. MOCK_CONST_METHOD0(isFrozen, bool());
  50. MOCK_CONST_METHOD1(isValidTarget, bool(bool));
  51. MOCK_CONST_METHOD0(isHypnotized, bool());
  52. MOCK_CONST_METHOD0(isInvincible, bool());
  53. MOCK_CONST_METHOD0(isClone, bool());
  54. MOCK_CONST_METHOD0(hasClone, bool());
  55. MOCK_CONST_METHOD0(canCast, bool());
  56. MOCK_CONST_METHOD0(isCaster, bool());
  57. MOCK_CONST_METHOD0(canShootBlocked, bool());
  58. MOCK_CONST_METHOD0(canShoot, bool());
  59. MOCK_CONST_METHOD0(isShooter, bool());
  60. MOCK_CONST_METHOD0(getCount, int32_t());
  61. MOCK_CONST_METHOD0(getFirstHPleft, int32_t());
  62. MOCK_CONST_METHOD0(getKilled, int32_t());
  63. MOCK_CONST_METHOD0(getAvailableHealth, int64_t());
  64. MOCK_CONST_METHOD0(getTotalHealth, int64_t());
  65. MOCK_CONST_METHOD1(getTotalAttacks, int(bool));
  66. MOCK_CONST_METHOD0(getPosition, BattleHex());
  67. MOCK_METHOD1(setPosition, void(const BattleHex&));
  68. MOCK_CONST_METHOD1(getInitiative, int32_t(int));
  69. MOCK_CONST_METHOD1(canMove, bool(int));
  70. MOCK_CONST_METHOD1(defended, bool(int));
  71. MOCK_CONST_METHOD1(moved, bool(int));
  72. MOCK_CONST_METHOD1(willMove, bool(int));
  73. MOCK_CONST_METHOD1(waited, bool(int));
  74. MOCK_CONST_METHOD0(getFactionID, FactionID());
  75. MOCK_CONST_METHOD1(battleQueuePhase, battle::BattlePhases::Type(int));
  76. MOCK_CONST_METHOD0(acquire, std::shared_ptr<battle::Unit>());
  77. MOCK_CONST_METHOD0(acquireState, std::shared_ptr<battle::CUnitState>());
  78. MOCK_METHOD1(save, void(JsonNode &));
  79. MOCK_METHOD1(load, void(const JsonNode &));
  80. MOCK_METHOD1(damage, void(int64_t &));
  81. MOCK_METHOD3(heal, battle::HealInfo(int64_t &, EHealLevel, EHealPower));
  82. };