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

Fix NPE with returnFire field. #11729

Merged
merged 2 commits into from
Jul 5, 2023
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 @@ -15,6 +15,7 @@
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import lombok.Builder;
import org.triplea.java.RemoveOnNextMajorRelease;

/** Build the steps for the fire round (roll dice, select casualties, and mark casualties) */
@Builder
Expand All @@ -24,7 +25,10 @@ public class FireRoundStepsFactory {
@Nonnull final BattleActions battleActions;
@Nonnull final Function<BattleState, Collection<FiringGroup>> firingGroupSplitter;
@Nonnull final BattleState.Side side;
@Nonnull final MustFightBattle.ReturnFire returnFire;

@RemoveOnNextMajorRelease("This is ReturnFire.ALL or null for everything except old saves")
final MustFightBattle.ReturnFire returnFire;

@Nonnull final BiFunction<IDelegateBridge, RollDiceStep, DiceRoll> diceRoller;
@Nonnull final BiFunction<IDelegateBridge, SelectCasualties, CasualtyDetails> casualtySelector;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MarkCasualties implements BattleStep {

private final FireRoundState fireRoundState;

@RemoveOnNextMajorRelease("This is ReturnFire.ALL for everything except old saves")
@RemoveOnNextMajorRelease("This is ReturnFire.ALL or null for everything except old saves")
private final MustFightBattle.ReturnFire returnFire;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.triplea.java.RemoveOnNextMajorRelease;

/** Generates fire steps for the first strike battle phase for the defensive player */
public class DefensiveFirstStrike implements BattleStep {
Expand All @@ -39,6 +40,7 @@ private enum State {

protected final State state;

@RemoveOnNextMajorRelease("This is ReturnFire.ALL or null for everything except old saves")
protected transient ReturnFire returnFire = ReturnFire.ALL;

public DefensiveFirstStrike(final BattleState battleState, final BattleActions battleActions) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.triplea.java.RemoveOnNextMajorRelease;

/** Generates fire steps for the first strike battle phase for the offensive player */
public class OffensiveFirstStrike implements BattleStep {
Expand All @@ -39,6 +40,7 @@ private enum State {

protected final State state;

@RemoveOnNextMajorRelease("This is ReturnFire.ALL or null for everything except old saves")
protected transient ReturnFire returnFire = ReturnFire.ALL;

public OffensiveFirstStrike(final BattleState battleState, final BattleActions battleActions) {
Expand Down