net.sf.freecol.common.model
Interface CombatModel

All Known Implementing Classes:
SimpleCombatModel

public interface CombatModel


Nested Class Summary
static class CombatModel.CombatOdds
          Odds a particular outcome will occur in combat.
static class CombatModel.CombatResult
           
static class CombatModel.CombatResultType
           
 
Method Summary
 void attack(Unit attacker, Unit defender, CombatModel.CombatResult result, int plunderGold, Location repairLocation)
          Attack a unit with the given outcome.
 void bombard(Colony colony, Unit defender, CombatModel.CombatResult result, Location repairLocation)
          Bombard a unit with the given outcome.
 CombatModel.CombatOdds calculateCombatOdds(Unit attacker, Unit defender)
          Calculates the chance of the outcomes of combat between the units.
 CombatModel.CombatResult generateAttackResult(Colony colony, Unit defender)
          Generates the result of a colony bombarding a Unit.
 CombatModel.CombatResult generateAttackResult(Unit attacker, Unit defender)
          Generates a result of an attack.
 float getDefencePower(Colony colony, Unit defender)
          Return the defensive power of the defender versus the bombarding colony.
 float getDefencePower(Unit attacker, Unit defender)
          Return the defensive power of the defender versus the attacker.
 java.util.Set<Modifier> getDefensiveModifiers(Colony colony, Unit defender)
          Return a list of all defensive modifiers that apply to the defender versus the bombarding colony.
 java.util.Set<Modifier> getDefensiveModifiers(Unit attacker, Unit defender)
          Return a list of all defensive modifiers that apply to the defender versus the attacker.
 float getOffencePower(Colony colony, Unit defender)
          Returns the power for bombarding
 float getOffencePower(Unit attacker, Unit defender)
          Return the offensive power of the attacker versus the defender.
 java.util.Set<Modifier> getOffensiveModifiers(Colony colony, Unit defender)
          Return a list of all offensive modifiers that apply to the attacker versus the defender.
 java.util.Set<Modifier> getOffensiveModifiers(Unit attacker, Unit defender)
          Return a list of all offensive modifiers that apply to the attacker versus the defender.
 

Method Detail

calculateCombatOdds

CombatModel.CombatOdds calculateCombatOdds(Unit attacker,
                                           Unit defender)
Calculates the chance of the outcomes of combat between the units.

Parameters:
attacker - The attacking Unit.
defender - The defending unit.
Returns:
A CombatOdds value.

generateAttackResult

CombatModel.CombatResult generateAttackResult(Unit attacker,
                                              Unit defender)
Generates a result of an attack.

Parameters:
attacker - The Unit attacking.
defender - The defending unit.
Returns:
a CombatResult value

generateAttackResult

CombatModel.CombatResult generateAttackResult(Colony colony,
                                              Unit defender)
Generates the result of a colony bombarding a Unit.

Parameters:
colony - the bombarding Colony
defender - the defending Unit
Returns:
a CombatResult value

getOffencePower

float getOffencePower(Colony colony,
                      Unit defender)
Returns the power for bombarding

Parameters:
colony - a Colony value
defender - an Unit value
Returns:
the power for bombarding

getOffencePower

float getOffencePower(Unit attacker,
                      Unit defender)
Return the offensive power of the attacker versus the defender.

Parameters:
attacker - an Unit value
defender - an Unit value
Returns:
a float value

getDefencePower

float getDefencePower(Colony colony,
                      Unit defender)
Return the defensive power of the defender versus the bombarding colony.

Parameters:
colony - a Colony value
defender - a Unit value
Returns:
an float value

getDefencePower

float getDefencePower(Unit attacker,
                      Unit defender)
Return the defensive power of the defender versus the attacker.

Parameters:
attacker - an Unit value
defender - an Unit value
Returns:
an float value

getOffensiveModifiers

java.util.Set<Modifier> getOffensiveModifiers(Colony colony,
                                              Unit defender)
Return a list of all offensive modifiers that apply to the attacker versus the defender.

Parameters:
colony - an Colony value
defender - an Unit value
Returns:
a List of Modifiers

getOffensiveModifiers

java.util.Set<Modifier> getOffensiveModifiers(Unit attacker,
                                              Unit defender)
Return a list of all offensive modifiers that apply to the attacker versus the defender.

Parameters:
attacker - an Unit value
defender - an Unit value
Returns:
a List of Modifiers

getDefensiveModifiers

java.util.Set<Modifier> getDefensiveModifiers(Unit attacker,
                                              Unit defender)
Return a list of all defensive modifiers that apply to the defender versus the attacker.

Parameters:
attacker - an Unit value
defender - an Unit value
Returns:
a List of Modifiers

getDefensiveModifiers

java.util.Set<Modifier> getDefensiveModifiers(Colony colony,
                                              Unit defender)
Return a list of all defensive modifiers that apply to the defender versus the bombarding colony.

Parameters:
colony - a Colony value
defender - an Unit value
Returns:
a List of Modifiers

attack

void attack(Unit attacker,
            Unit defender,
            CombatModel.CombatResult result,
            int plunderGold,
            Location repairLocation)
Attack a unit with the given outcome.

Parameters:
attacker - an Unit value
defender - The Unit defending against attack.
result - The result of the attack.
plunderGold - an int value

bombard

void bombard(Colony colony,
             Unit defender,
             CombatModel.CombatResult result,
             Location repairLocation)
Bombard a unit with the given outcome.

Parameters:
colony - a Colony value
defender - The Unit defending against bombardment.
result - The result of the bombardment.