File: mock_battle_Unit.h

package info (click to toggle)
vcmi 0.99%2Bdfsg%2Bgit20190113.f06c8a87-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 11,136 kB
  • sloc: cpp: 142,615; sh: 315; objc: 248; makefile: 32; ansic: 28; python: 13
file content (91 lines) | stat: -rw-r--r-- 3,376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
 * mock_battle_Unit.h, part of VCMI engine
 *
 * Authors: listed in file AUTHORS in main folder
 *
 * License: GNU General Public License v2.0 or later
 * Full text of license available in license.txt file, in main folder
 *
 */

#pragma once

#include "../../lib/battle/Unit.h"

class UnitMock : public battle::Unit
{
public:
	MOCK_CONST_METHOD4(getAllBonuses, const TBonusListPtr(const CSelector &, const CSelector &, const CBonusSystemNode *, const std::string &));
	MOCK_CONST_METHOD0(getTreeVersion, int64_t());

	MOCK_CONST_METHOD0(getCasterUnitId, int32_t());
	MOCK_CONST_METHOD2(getSpellSchoolLevel, ui8(const spells::Spell *, int *));
	MOCK_CONST_METHOD1(getEffectLevel, int(const spells::Spell *));
	MOCK_CONST_METHOD3(getSpellBonus, int64_t(const spells::Spell *, int64_t, const battle::Unit *));
	MOCK_CONST_METHOD2(getSpecificSpellBonus, int64_t(const spells::Spell *, int64_t));
	MOCK_CONST_METHOD1(getEffectPower, int(const spells::Spell *));
	MOCK_CONST_METHOD1(getEnchantPower, int(const spells::Spell *));
	MOCK_CONST_METHOD1(getEffectValue, int64_t(const spells::Spell *));
	MOCK_CONST_METHOD0(getOwner, const PlayerColor());
	MOCK_CONST_METHOD1(getCasterName, void(MetaString &));
	MOCK_CONST_METHOD3(getCastDescription, void(const spells::Spell *, const std::vector<const battle::Unit *> &, MetaString &));
	MOCK_CONST_METHOD2(spendMana, void(const spells::PacketSender *, const int));

	MOCK_CONST_METHOD0(unitBaseAmount, int32_t());
	MOCK_CONST_METHOD0(unitId, uint32_t());
	MOCK_CONST_METHOD0(unitSide, ui8());
	MOCK_CONST_METHOD0(unitOwner, PlayerColor());
	MOCK_CONST_METHOD0(unitSlot, SlotID());
	MOCK_CONST_METHOD0(unitType, const CCreature * ());

	MOCK_CONST_METHOD0(doubleWide, bool());

	MOCK_CONST_METHOD0(creatureIndex, int32_t());
	MOCK_CONST_METHOD0(creatureId, CreatureID());
	MOCK_CONST_METHOD0(creatureLevel, int32_t());
	MOCK_CONST_METHOD0(creatureCost, int32_t());
	MOCK_CONST_METHOD0(creatureIconIndex, int32_t());

	MOCK_CONST_METHOD0(ableToRetaliate, bool());
	MOCK_CONST_METHOD0(alive, bool());
	MOCK_CONST_METHOD0(isGhost, bool());
	MOCK_CONST_METHOD1(isValidTarget, bool(bool));

	MOCK_CONST_METHOD0(isClone, bool());
	MOCK_CONST_METHOD0(hasClone, bool());
	MOCK_CONST_METHOD0(canCast, bool());
	MOCK_CONST_METHOD0(isCaster, bool());
	MOCK_CONST_METHOD0(canShoot, bool());
	MOCK_CONST_METHOD0(isShooter, bool());

	MOCK_CONST_METHOD0(getCount, int32_t());
	MOCK_CONST_METHOD0(getFirstHPleft, int32_t());
	MOCK_CONST_METHOD0(getKilled, int32_t());
	MOCK_CONST_METHOD0(getAvailableHealth, int64_t());
	MOCK_CONST_METHOD0(getTotalHealth, int64_t());

	MOCK_CONST_METHOD1(getTotalAttacks, int(bool));

	MOCK_CONST_METHOD0(getPosition, BattleHex());
	MOCK_METHOD1(setPosition, void(BattleHex));
	MOCK_CONST_METHOD1(getInitiative, int32_t(int));

	MOCK_CONST_METHOD1(canMove, bool(int));
	MOCK_CONST_METHOD1(defended, bool(int));
	MOCK_CONST_METHOD1(moved, bool(int));
	MOCK_CONST_METHOD1(willMove, bool(int));
	MOCK_CONST_METHOD1(waited, bool(int));

	MOCK_CONST_METHOD1(battleQueuePhase, int(int));

	MOCK_CONST_METHOD0(acquire, std::shared_ptr<battle::Unit>());
	MOCK_CONST_METHOD0(acquireState, std::shared_ptr<battle::CUnitState>());

	MOCK_METHOD1(save, void(JsonNode &));
	MOCK_METHOD1(load, void(const JsonNode &));

	MOCK_METHOD1(damage, void(int64_t &));
	MOCK_METHOD3(heal, void(int64_t &, EHealLevel, EHealPower));
};