1 /*
2  * This file is part of EasyRPG Player.
3  *
4  * EasyRPG Player is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * EasyRPG Player is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef EP_GAME_PARTY_BASE_H
19 #define EP_GAME_PARTY_BASE_H
20 
21 #include <vector>
22 #include "game_actor.h"
23 #include "main_data.h"
24 
25 /**
26  * Base class of the two Parties (Allied and Enemy)
27  */
28 class Game_Party_Base {
29 public:
30 	virtual ~Game_Party_Base();
31 
32 	/**
33 	 * Gets a battler from the party by position in the party
34 	 *
35 	 * @param index Index of member to return
36 	 * @return Party battler
37 	 */
38 	virtual Game_Battler& operator[] (const int index) = 0;
39 
40 	/**
41 	 * Returns how many members are in the party
42 	 *
43 	 * @return Number of members in the party
44 	 */
45 	virtual int GetBattlerCount() const = 0;
46 
47 	/**
48 	 * Returns how many members are in the party and not hidden
49 	 *
50 	 * @return Number of members in the party who are not hidden
51 	 */
52 	virtual int GetVisibleBattlerCount() const = 0;
53 
54 	/**
55 	 * Returns a list of all battlers in the party
56 	 *
57 	 * @param out List of all battlers
58 	 */
59 	virtual void GetBattlers(std::vector<Game_Battler*>& out);
60 
61 	/**
62 	 * Gets a list with all active (not dead or hidden) party members.
63 	 *
64 	 * @return list of all active party members
65 	 */
66 	virtual void GetActiveBattlers(std::vector<Game_Battler*>& out);
67 
68 	/**
69 	 * Returns a list of all dead battlers in the party
70 	 *
71 	 * @param out List of all dead battlers
72 	 */
73 	virtual void GetDeadBattlers(std::vector<Game_Battler*>& out);
74 
75 	/**
76 	 * Return the next active battler (not dead or hidden) in the party based on
77 	 * the passed battler.
78 	 *
79 	 * @param battler Battler
80 	 * @return Battler after the provided one, NULL if battler isn't in party at all.
81 	 */
82 	virtual Game_Battler* GetNextActiveBattler(Game_Battler* battler);
83 
84 	/**
85 	 * Gets a random active (not dead or hidden) battler from the party
86 	 * @return Random alive battler
87 	 */
88 	virtual Game_Battler* GetRandomActiveBattler();
89 
90 	/**
91 	 * Gets a random dead battler from the party
92 	 *
93 	 * @return Random dead battler
94 	 */
95 	virtual Game_Battler* GetRandomDeadBattler();
96 
97 	/**
98 	 * Tests if any party members is active (not dead or hidden)
99 	 *
100 	 * @return Whether all are dead.
101 	 */
102 	virtual bool IsAnyActive();
103 
104 	/**
105 	 * Gets average agility of the party (for battle)
106 	 *
107 	 * @return average agility
108 	 */
109 	int GetAverageAgility();
110 
111 private:
112 
113 };
114 
115 #endif
116