Skip to content

Commit f283a36

Browse files
committed
Add assertNever for exhaustive difficulty handling in AttackExecution
1 parent 3258452 commit f283a36

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/execution/AttackExecution.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "../game/Game";
1414
import { TileRef } from "../game/GameMap";
1515
import { PseudoRandom } from "../PseudoRandom";
16+
import { assertNever } from "../Util";
1617
import { FlatBinaryHeap } from "./utils/FlatBinaryHeap"; // adjust path if needed
1718

1819
const malusForRetreat = 25;
@@ -168,6 +169,8 @@ export class AttackExecution implements Execution {
168169
case Difficulty.Impossible:
169170
relationChange = -100;
170171
break;
172+
default:
173+
assertNever(difficulty);
171174
}
172175
this.target.updateRelation(this._owner, relationChange);
173176
}

0 commit comments

Comments
 (0)