Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new roll dice, select casualties, and remove casualties steps #8087

Merged
merged 1 commit into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import games.strategy.engine.delegate.IDelegateBridge;
import games.strategy.engine.player.Player;
import games.strategy.triplea.ai.weak.WeakAi;
import games.strategy.triplea.attachments.UnitAttachment;
import games.strategy.triplea.delegate.Matches;
import games.strategy.triplea.delegate.TerritoryEffectHelper;
import games.strategy.triplea.delegate.TransportTracker;
Expand Down Expand Up @@ -345,19 +344,6 @@ static GamePlayer findPlayerWithMostUnits(final Collection<Unit> units) {
return player;
}

/**
* The maximum number of hits that this collection of units can sustain, taking into account units
* with two hits, and accounting for existing damage.
*/
static int getMaxHits(final Collection<Unit> units) {
int count = 0;
for (final Unit unit : units) {
count += UnitAttachment.get(unit.getType()).getHitPoints();
count -= unit.getHits();
}
return count;
}

void markDamaged(final Collection<Unit> damaged, final IDelegateBridge bridge) {
BattleDelegate.markDamaged(damaged, bridge, battleSite);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
import games.strategy.triplea.ai.weak.WeakAi;
import games.strategy.triplea.delegate.battle.MustFightBattle.ReturnFire;
import java.util.Collection;
import java.util.function.Predicate;

/** Actions that can occur in a battle that require interaction with {@link IDelegateBridge} */
public interface BattleActions {

void fireOffensiveAaGuns();

void fireDefensiveAaGuns();

void fireNavalBombardment(IDelegateBridge bridge);

void removeNonCombatants(IDelegateBridge bridge);

void clearWaitingToDieAndDamagedChangesInto(IDelegateBridge bridge);
Expand All @@ -28,17 +21,6 @@ void removeCasualties(

void endBattle(IBattle.WhoWon whoWon, IDelegateBridge bridge);

void findTargetGroupsAndFire(
ReturnFire returnFire,
String stepName,
boolean defending,
GamePlayer firingPlayer,
Predicate<Unit> firingUnitPredicate,
Collection<Unit> firingUnits,
Collection<Unit> firingUnitsWaitingToDie,
Collection<Unit> enemyUnits,
Collection<Unit> enemyUnitsWaitingToDie);

void remove(
Collection<Unit> killedUnits,
IDelegateBridge bridge,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ public boolean isFirstRound() {

void retreatUnits(Side side, Collection<Unit> units);

Collection<Unit> getAa(Side... sides);

Collection<Unit> getBombardingUnits();

GamePlayer getPlayer(Side side);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ public interface BattleStepStrings {

String AA_GUNS_FIRE_SUFFIX = " fire";
String FIRE_SUFFIX = " fire";
String FIRST_STRIKE_UNITS_FIRE_SUFFIX = " first strike units fire";
String SELECT_PREFIX = " select ";
String REMOVE_PREFIX = " remove ";
String NOTIFY_PREFIX = " notify ";
String CASUALTIES_SUFFIX = " casualties";
String CASUALTIES_WITHOUT_SPACE_SUFFIX = "casualties";
String LAND_PARATROOPS = "Land Paratroopers";
Expand All @@ -21,8 +22,6 @@ public interface BattleStepStrings {
String UNITS = "units";
String FIRST_STRIKE_UNITS = "first strike units";
String REMOVE_SNEAK_ATTACK_CASUALTIES = "Remove sneak attack casualties";
String FIRE = " fire";
String FIRST_STRIKE_UNITS_FIRE = " first strike units fire";
String SELECT_FIRST_STRIKE_CASUALTIES = " select first strike casualties";
String SELECT_CASUALTIES = " select casualties";
String REMOVE_CASUALTIES = "Remove casualties";
Expand Down
Loading