games.strategy.triplea.player
Interface ITripleaPlayer

All Superinterfaces:
IRemote
All Known Implementing Classes:
AbstractAI, StrongAI, TripleAPlayer, WeakAI

public interface ITripleaPlayer
extends IRemote

Interface the TriplePlayer presents to Delegates through IRemoteMessenger

Author:
Sean Bridges

Method Summary
 void confirmEnemyCasualties(GUID battleId, java.lang.String message, PlayerID hitPlayer)
          Allows the user to pause and confirm enemy casualties
 boolean confirmMoveHariKari()
          The attempted move will kill some units
 boolean confirmMoveInFaceOfAA(java.util.Collection<Territory> aaFiringTerritories)
          The attempted move will incur aa fire, confirm that you still want to move
 boolean confirmMoveKamikaze()
          The attempted move will kill some air units
 void confirmOwnCasualties(GUID battleId, java.lang.String message)
           
 PlayerID getID()
           
 java.util.Collection<Unit> getNumberOfFightersToMoveToNewCarrier(java.util.Collection<Unit> fightersThatCanBeMoved, Territory from)
          get the fighters to move to a newly produced carrier
 void reportError(java.lang.String error)
          Report an error to the user.
 void reportMessage(java.lang.String message)
          report a message to the user
 Territory retreatQuery(GUID battleID, boolean submerge, java.util.Collection<Territory> possibleTerritories, java.lang.String message)
          Ask the player if he wishes to retreat.
 boolean selectAttackSubs(Territory unitTerritory)
          Ask if the player wants to attack lone subs
 boolean selectAttackTransports(Territory unitTerritory)
          Ask if the player wants to attack lone transports
 boolean selectAttackUnits(Territory unitTerritory)
          Ask if the player wants to attack units
 Territory selectBombardingTerritory(Unit unit, Territory unitTerritory, java.util.Collection<Territory> territories, boolean noneAvailable)
          Select the territory to bombard with the bombarding capable unit (eg battleship)
 CasualtyDetails selectCasualties(java.util.Collection<Unit> selectFrom, java.util.Map<Unit,java.util.Collection<Unit>> dependents, int count, java.lang.String message, DiceRoll dice, PlayerID hit, java.util.List<Unit> defaultCasualties, GUID battleID)
          Select casualties
 int[] selectFixedDice(int numDice, int hitAt, boolean hitOnlyIfEquals, java.lang.String title)
          Select a fixed dice roll
 boolean selectShoreBombard(Territory unitTerritory)
          Ask if the player wants to shore bombard
 Territory selectTerritoryForAirToLand(java.util.Collection<Territory> candidates)
          Some carriers were lost while defending.
 boolean shouldBomberBomb(Territory territory)
          One or more bombers have just moved into a territory where a strategic bombing raid can be conducted, should the bomber bomb?
 Territory whereShouldRocketsAttack(java.util.Collection<Territory> candidates, Territory from)
          Choose where my rockets should fire
 

Method Detail

selectCasualties

CasualtyDetails selectCasualties(java.util.Collection<Unit> selectFrom,
                                 java.util.Map<Unit,java.util.Collection<Unit>> dependents,
                                 int count,
                                 java.lang.String message,
                                 DiceRoll dice,
                                 PlayerID hit,
                                 java.util.List<Unit> defaultCasualties,
                                 GUID battleID)
Select casualties

Parameters:
selectFrom - - the units to select casualties from
dependents - - dependents of the units to select from
count - - the number of casualties to select
message - - ui message to display
hit - - the player hit
dice - - the dice rolled for the casualties
defaultCasualties - - default casualties as selected by the game
battleID - - the battle we are fighting in, may be null if this is an aa casualty selection during a move
Returns:
the selected casualties Added new collection autoKilled to handle killing units prior to casualty selection

selectFixedDice

int[] selectFixedDice(int numDice,
                      int hitAt,
                      boolean hitOnlyIfEquals,
                      java.lang.String title)
Select a fixed dice roll

Parameters:
numDice - - the number of dice rolls
hitAt - - the lowest roll that constitutes a hit (0 for none)
hitOnlyIfEquals - - whether to count rolls greater than hitAt as hits
title - - the title for the DiceChooser
Returns:
the resulting dice array

selectBombardingTerritory

Territory selectBombardingTerritory(Unit unit,
                                    Territory unitTerritory,
                                    java.util.Collection<Territory> territories,
                                    boolean noneAvailable)
Select the territory to bombard with the bombarding capable unit (eg battleship)

Parameters:
unit - - the bombarding unit
unitTerritory - - where the bombarding unit is
territories - - territories where the unit can bombard
noneAvailable -
Returns:
the Territory to bombard in, null if the unit should not bombard

selectAttackSubs

boolean selectAttackSubs(Territory unitTerritory)
Ask if the player wants to attack lone subs

Parameters:
unitTerritory - - where the potential battle is

selectAttackTransports

boolean selectAttackTransports(Territory unitTerritory)
Ask if the player wants to attack lone transports

Parameters:
unitTerritory - - where the potential battle is

selectAttackUnits

boolean selectAttackUnits(Territory unitTerritory)
Ask if the player wants to attack units

Parameters:
unitTerritory - - where the potential battle is

selectShoreBombard

boolean selectShoreBombard(Territory unitTerritory)
Ask if the player wants to shore bombard

Parameters:
unitTerritory - - where the potential battle is

reportError

void reportError(java.lang.String error)
Report an error to the user.

Parameters:
report - that an error occurred

reportMessage

void reportMessage(java.lang.String message)
report a message to the user

Parameters:
message -

shouldBomberBomb

boolean shouldBomberBomb(Territory territory)
One or more bombers have just moved into a territory where a strategic bombing raid can be conducted, should the bomber bomb?


whereShouldRocketsAttack

Territory whereShouldRocketsAttack(java.util.Collection<Territory> candidates,
                                   Territory from)
Choose where my rockets should fire

Parameters:
candidates - - a collection of Territories, the possible territories to attack
from - - where the rockets are launched from, null for WW2V1 rules
Returns:
the territory to attack, null if no territory should be attacked

getNumberOfFightersToMoveToNewCarrier

java.util.Collection<Unit> getNumberOfFightersToMoveToNewCarrier(java.util.Collection<Unit> fightersThatCanBeMoved,
                                                                 Territory from)
get the fighters to move to a newly produced carrier

Parameters:
fightersThatCanBeMoved - - the fighters that can be moved
from - - the territory containing the factory
Returns:
- the fighters to move

selectTerritoryForAirToLand

Territory selectTerritoryForAirToLand(java.util.Collection<Territory> candidates)
Some carriers were lost while defending. We must select where to land some air units.

Parameters:
candidates - - a list of territories - these are the places where air units can land
Returns:
- the territory to land the fighters in, must be non null

confirmMoveInFaceOfAA

boolean confirmMoveInFaceOfAA(java.util.Collection<Territory> aaFiringTerritories)
The attempted move will incur aa fire, confirm that you still want to move

Parameters:
aaFiringTerritories - - the territories where aa will fire

confirmMoveKamikaze

boolean confirmMoveKamikaze()
The attempted move will kill some air units


confirmMoveHariKari

boolean confirmMoveHariKari()
The attempted move will kill some units


retreatQuery

Territory retreatQuery(GUID battleID,
                       boolean submerge,
                       java.util.Collection<Territory> possibleTerritories,
                       java.lang.String message)
Ask the player if he wishes to retreat.

Parameters:
battleID - - the battle
submerge - - is submerging possible
possibleTerritories - - where the player can retreat to
message - - user displayable message
Returns:
the territory to retreat to, or null if the player doesnt wish to retreat

confirmEnemyCasualties

void confirmEnemyCasualties(GUID battleId,
                            java.lang.String message,
                            PlayerID hitPlayer)
Allows the user to pause and confirm enemy casualties

Parameters:
battleId -
message -

confirmOwnCasualties

void confirmOwnCasualties(GUID battleId,
                          java.lang.String message)

getID

PlayerID getID()