forked from EasyRPG/Player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_party_base.h
115 lines (98 loc) · 2.82 KB
/
game_party_base.h
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/*
* This file is part of EasyRPG Player.
*
* EasyRPG Player is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* EasyRPG Player is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef EP_GAME_PARTY_BASE_H
#define EP_GAME_PARTY_BASE_H
#include <vector>
#include "game_actor.h"
#include "main_data.h"
/**
* Base class of the two Parties (Allied and Enemy)
*/
class Game_Party_Base {
public:
virtual ~Game_Party_Base();
/**
* Gets a battler from the party by position in the party
*
* @param index Index of member to return
* @return Party battler
*/
virtual Game_Battler& operator[] (const int index) = 0;
/**
* Returns how many members are in the party
*
* @return Number of members in the party
*/
virtual int GetBattlerCount() const = 0;
/**
* Returns how many members are in the party and not hidden
*
* @return Number of members in the party who are not hidden
*/
virtual int GetVisibleBattlerCount() const = 0;
/**
* Returns a list of all battlers in the party
*
* @param out List of all battlers
*/
virtual void GetBattlers(std::vector<Game_Battler*>& out);
/**
* Gets a list with all active (not dead or hidden) party members.
*
* @return list of all active party members
*/
virtual void GetActiveBattlers(std::vector<Game_Battler*>& out);
/**
* Returns a list of all dead battlers in the party
*
* @param out List of all dead battlers
*/
virtual void GetDeadBattlers(std::vector<Game_Battler*>& out);
/**
* Return the next active battler (not dead or hidden) in the party based on
* the passed battler.
*
* @param battler Battler
* @return Battler after the provided one, NULL if battler isn't in party at all.
*/
virtual Game_Battler* GetNextActiveBattler(Game_Battler* battler);
/**
* Gets a random active (not dead or hidden) battler from the party
* @return Random alive battler
*/
virtual Game_Battler* GetRandomActiveBattler();
/**
* Gets a random dead battler from the party
*
* @return Random dead battler
*/
virtual Game_Battler* GetRandomDeadBattler();
/**
* Tests if any party members is active (not dead or hidden)
*
* @return Whether all are dead.
*/
virtual bool IsAnyActive();
/**
* Gets average agility of the party (for battle)
*
* @return average agility
*/
int GetAverageAgility();
private:
};
#endif