Skip to content

Commit

Permalink
use ternary operator
Browse files Browse the repository at this point in the history
  • Loading branch information
GideonPotok committed Mar 7, 2024
1 parent 62557ef commit d0eaa1a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ui/analyse/src/practice/practiceCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,10 @@ export function make(root: AnalyseCtrl, playableDepth: () => number): PracticeCt
}

function isMyTurn(): boolean {
if (root.data.game.variant.key === 'racingKings') {
return root.turnColor() === root.playerColor();
} else {
return root.turnColor() === root.bottomColor();
}
return (
root.turnColor() ===
(root.data.game.variant.key === 'racingKings' ? root.playerColor() : root.bottomColor())
);
}

function checkCeval() {
Expand Down

0 comments on commit d0eaa1a

Please sign in to comment.