Skip to content

Commit

Permalink
apply noClaimWin rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 22, 2022
1 parent 994ef03 commit 8cd9839
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/game/src/main/Game.scala
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,11 @@ case class Game(
)
}

def resignable = playable && !abortable
def forceResignable = resignable && nonAi && !fromFriend && hasClock && !isSwiss
def drawable = playable && !abortable && !swissPreventsDraw
def forceDrawable = playable && !abortable
def resignable = playable && !abortable
def forceResignable =
resignable && nonAi && !fromFriend && hasClock && !isSwiss && !metadata.hasRule(_.NoClaimWin)
def drawable = playable && !abortable && !swissPreventsDraw
def forceDrawable = playable && !abortable && !metadata.hasRule(_.NoClaimWin)

def finish(status: Status, winner: Option[Color]): Game =
copy(
Expand Down
1 change: 1 addition & 0 deletions ui/round/src/view/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export function standard(

export function opponentGone(ctrl: RoundController) {
const gone = ctrl.opponentGone();
if (ctrl.data.game.rules?.includes('noClaimWin')) return null;
return gone === true
? h('div.suggestion', [
h('p', { hook: onSuggestionHook }, ctrl.noarg('opponentLeftChoices')),
Expand Down

0 comments on commit 8cd9839

Please sign in to comment.