-
Notifications
You must be signed in to change notification settings - Fork 396
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue 12688 (battle calc on own territory shows own player as attacker and defender) Desired: 1. Attacker: Current player always, except when only allied units present (then next enemy) 2. Defender: As enemy to attacker with most units (fallback: whomever is at war and has the next turn) AttackerAndDefenderSelectorTest.java - simplification of method getAttackerAndDefender() - new methods getBestAttacker() and getBestAttacker() - removed now unused methods getOpponentWithPriorityList, playersAtWarWith, neutralPlayersTowards, getEnemyWithMostUnits UnitCollection.java - rename method getPlayersByUnitCount to getPlayersSortedByUnitCount BattleCalculatorDialog.java - extract common logic from method addAttackers and addDefenders to new method adjustBattleCalculatorPanel - extract static attribute modifications from instance method dispose into new static method disposeInstance (especially pack also for adding attacker) BattleCalculatorPanel.java - introduce new methods setAttackerWithUnits and setDefenderWithUnits to limit attacker/defender change to own instance - make setter of attribute attacker/defender private - rename methods hasAttackingUnitsAdded and hasDefendingUnitsAdded to hasAttackingUnits and hasDefendingUnits - rename attribute attackerUnitsTotalHitpoints to attackerUnitsTotalHitPoints
- Loading branch information
Showing
5 changed files
with
173 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.