|
25 | 25 | import net.tfminecraft.simplefactions.war.campaign.progression.AttackerNavalContestService; |
26 | 26 | import net.tfminecraft.simplefactions.war.campaign.progression.CampaignCapabilityService; |
27 | 27 | import net.tfminecraft.simplefactions.war.campaign.progression.postbattle.CampaignOffensiveForfeitService; |
| 28 | +import net.tfminecraft.simplefactions.war.campaign.runtime.BattleAutoresolveService; |
28 | 29 | import net.tfminecraft.simplefactions.war.campaign.runtime.BattleScheduleService; |
29 | 30 | import net.tfminecraft.simplefactions.war.campaign.runtime.BattleSideMembers; |
30 | 31 | import net.tfminecraft.simplefactions.war.campaign.runtime.BattleWindowService; |
@@ -69,37 +70,13 @@ public static Battle prepareScheduledBattle(War war) { |
69 | 70 | return battle; |
70 | 71 | } |
71 | 72 |
|
| 73 | + /** Simulated result. Does not create or start a live battle. */ |
72 | 74 | public static Battle launchAutoresolveBattle(War war) { |
73 | 75 | if (war == null || !war.isActive()) { |
74 | 76 | return null; |
75 | 77 | } |
76 | | - Battle existing = BattleManager.getByWarId(war.getId()); |
77 | | - Integer provinceId = BattleScheduleService.resolveScheduledProvinceId(war); |
78 | | - if (provinceId != null |
79 | | - && AttackerNavalContestService.applyIfAttackerHasNoBerthedNavy(war, provinceId)) { |
80 | | - return null; |
81 | | - } |
82 | | - |
83 | | - if (existing != null) { |
84 | | - String startError = startPreparedBattle(war, existing); |
85 | | - if (startError != null) { |
86 | | - logWarning("Could not start autoresolve battle: " + startError); |
87 | | - } |
88 | | - return existing; |
89 | | - } |
90 | | - |
91 | | - if (provinceId == null) { |
92 | | - return null; |
93 | | - } |
94 | | - |
95 | | - Battle battle = createCampaignBattle(war, provinceId, true); |
96 | | - if (battle != null) { |
97 | | - String startError = startPreparedBattle(war, battle); |
98 | | - if (startError != null) { |
99 | | - logWarning("Could not start autoresolve battle: " + startError); |
100 | | - } |
101 | | - } |
102 | | - return battle; |
| 78 | + BattleAutoresolveService.resolve(war); |
| 79 | + return null; |
103 | 80 | } |
104 | 81 |
|
105 | 82 | public static boolean tryStartScheduledBattle(War war, Instant now) { |
|
0 commit comments