Skip to content

Commit e63fbc7

Browse files
author
Christopher Field
committed
Fixing scoring display in bluestone
1 parent 217855a commit e63fbc7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/games/bluestone.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,8 @@ export class BluestoneGame extends GameBase {
513513
if (score != 0) playerScores.push(score);
514514
});
515515
playerScores.sort((a,b) => b-a);
516-
this.groupScores[player] = [...playerScores];
516+
this.groupScores[player-1] = [...playerScores];
517+
if (this.groupScores[player-1].length == 0) this.groupScores[player-1] = [0];
517518

518519
// We use string concat to avoid js nonsense.
519520
// Show up to the first 5 group scores and call that good enough.
@@ -564,9 +565,10 @@ export class BluestoneGame extends GameBase {
564565
}
565566

566567
public getPlayersScores(): IScores[] {
567-
return [
568-
{ name: i18next.t("apgames:status.SCORES"), scores: [this.getPlayerScore(1), this.getPlayerScore(2)] },
569-
]
568+
return [{
569+
name: i18next.t("apgames:status.SCORES"),
570+
scores: [this.groupScores[0].join(","), this.groupScores[1].join(",")]
571+
}];
570572
}
571573

572574
public state(): IBluestoneState {
@@ -595,7 +597,6 @@ export class BluestoneGame extends GameBase {
595597
}
596598

597599
public getPlayerColour(player: PlayerId): number | string {
598-
599600
return (player === 1) ? 1 : 3;
600601
}
601602

@@ -674,8 +675,9 @@ export class BluestoneGame extends GameBase {
674675
}
675676

676677
status += "**Scores**\n\n";
678+
console.log(this.groupScores);
677679
for (let n = 1; n <= this.numplayers; n++) {
678-
const score = this.getPlayerScore(n as PlayerId);
680+
const score = this.groupScores[n-1].join(",");
679681
status += `Player ${n}: ${score}\n\n`;
680682
}
681683

0 commit comments

Comments
 (0)