Skip to content

Commit

Permalink
Reject mismatch in final pumpjack count
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Dec 31, 2023
1 parent 2355cb3 commit e83308c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FactorioTools/OilField/Planner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ private static (Context Context, OilFieldPlanSummary Summary) Execute(

var finalPumpjackCount = context.CenterToTerminals.Count;

if (finalPumpjackCount != initialPumpjackCount)
{
throw new FactorioToolsException("The initial number of pumpjacks does not match the final pumpjack count.");
}

var planSummary = new OilFieldPlanSummary(
initialPumpjackCount - finalPumpjackCount,
selectedPlans,
Expand Down

0 comments on commit e83308c

Please sign in to comment.