2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
6
* This program is distributed in the hope that it will be useful,
7
* but WITHOUT ANY WARRANTY; without even the implied warranty of
8
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9
* GNU General Public License for more details.
10
* You should have received a copy of the GNU General Public License
11
* along with this program; if not, write to the Free Software
12
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
package games.strategy.triplea.player;
19
import games.strategy.engine.data.*;
20
import games.strategy.engine.data.PlayerID;
21
import games.strategy.engine.message.IRemote;
22
import games.strategy.net.*;
23
import games.strategy.triplea.delegate.DiceRoll;
24
import games.strategy.triplea.delegate.dataObjects.CasualtyDetails;
27
* Interface the TriplePlayer presents to Delegates through IRemoteMessenger
29
* @author Sean Bridges
31
public interface ITripleaPlayer extends IRemote
37
* @param selectFrom - the units to select casualties from
38
* @param dependents - dependents of the units to select from
39
* @param count - the number of casualties to select
40
* @param message - ui message to display
41
* @param hit - the player hit
42
* @param dice - the dice rolled for the casualties
43
* @param defaultCasualties - default casualties as selected by the game
44
* @param battleID - the battle we are fighting in, may be null if this is an aa casualty selection during a move
45
* @return the selected casualties
47
* Added new collection autoKilled to handle killing units prior to casualty selection
50
public CasualtyDetails selectCasualties(
51
Collection<Unit> selectFrom, Map<Unit, Collection<Unit>> dependents, int count, String message, DiceRoll dice, PlayerID hit, List<Unit> defaultCasualties, GUID battleID
54
* Select a fixed dice roll
56
* @param numDice - the number of dice rolls
57
* @param hitAt - the lowest roll that constitutes a hit (0 for none)
58
* @param hitOnlyIfEquals - whether to count rolls greater than hitAt as hits
59
* @param title - the title for the DiceChooser
60
* @param diceSides - the number of sides on the die, found by data.getDiceSides()
61
* @return the resulting dice array
63
public int[] selectFixedDice(int numDice, int hitAt, boolean hitOnlyIfEquals, String title, int diceSides);
66
* Select the territory to bombard with the bombarding capable unit (eg battleship)
68
* @param unit - the bombarding unit
69
* @param unitTerritory - where the bombarding unit is
70
* @param territories - territories where the unit can bombard
71
* @param noneAvailable
72
* @return the Territory to bombard in, null if the unit should not bombard
74
public Territory selectBombardingTerritory(
76
Territory unitTerritory,
77
Collection<Territory> territories,
82
* Ask if the player wants to attack lone subs
84
* @param unitTerritory - where the potential battle is
86
public boolean selectAttackSubs(
87
Territory unitTerritory
91
* Ask if the player wants to attack lone transports
93
* @param unitTerritory - where the potential battle is
95
public boolean selectAttackTransports(
96
Territory unitTerritory
100
* Ask if the player wants to attack units
102
* @param unitTerritory - where the potential battle is
104
public boolean selectAttackUnits(
105
Territory unitTerritory
109
* Ask if the player wants to shore bombard
111
* @param unitTerritory - where the potential battle is
113
public boolean selectShoreBombard(
114
Territory unitTerritory
118
* Report an error to the user.
120
* @param report that an error occurred
122
public void reportError(String error);
125
* report a message to the user
128
public void reportMessage(String message);
131
* One or more bombers have just moved into a territory where a strategic bombing
132
* raid can be conducted, should the bomber bomb?
134
public boolean shouldBomberBomb(Territory territory);
137
* One or more bombers have just moved into a territory where a strategic bombing
138
* raid can be conducted, what should the bomber bomb?
140
public Unit whatShouldBomberBomb(Territory territory, Collection<Unit> units);
142
* Choose where my rockets should fire
144
* @param candidates - a collection of Territories, the possible territories to attack
145
* @param from - where the rockets are launched from, null for WW2V1 rules
146
* @return the territory to attack, null if no territory should be attacked
148
public Territory whereShouldRocketsAttack(Collection<Territory> candidates, Territory from);
151
* get the fighters to move to a newly produced carrier
153
* @param fightersThatCanBeMoved - the fighters that can be moved
154
* @param from - the territory containing the factory
155
* @return - the fighters to move
157
public Collection<Unit> getNumberOfFightersToMoveToNewCarrier(Collection<Unit> fightersThatCanBeMoved, Territory from);
160
* Some carriers were lost while defending. We must select where to land
163
* @param candidates - a list of territories - these are the places where air units can land
164
* @return - the territory to land the fighters in, must be non null
166
public Territory selectTerritoryForAirToLand(Collection<Territory> candidates);
170
* The attempted move will incur aa fire, confirm that you still want to move
172
* @param aaFiringTerritories - the territories where aa will fire
174
public boolean confirmMoveInFaceOfAA(Collection<Territory> aaFiringTerritories);
177
* The attempted move will kill some air units
180
public boolean confirmMoveKamikaze();
183
* The attempted move will kill some units
186
public boolean confirmMoveHariKari();
190
* Ask the player if he wishes to retreat.
192
* @param battleID - the battle
193
* @param submerge - is submerging possible
194
* @param possibleTerritories - where the player can retreat to
195
* @param message - user displayable message
196
* @return the territory to retreat to, or null if the player doesnt wish to retreat
198
public Territory retreatQuery(GUID battleID, boolean submerge, Collection<Territory> possibleTerritories, String message);
203
* Ask the player if he wishes to scramble units to the battle.
205
* @param battleID - the battle
206
* @param possibleTerritories - where the player can retreat to
207
* @param message - user displayable message
208
* @return the territory to retreat to, or null if the player doesn't wish to retreat
210
public Collection<Unit> scrambleQuery(GUID battleID, Collection<Territory> possibleTerritories, String message);
213
* Allows the user to pause and confirm enemy casualties
218
public void confirmEnemyCasualties(GUID battleId, String message, PlayerID hitPlayer);
220
public void confirmOwnCasualties(GUID battleId, String message);
222
public PlayerID getID();