Skip to content

Commit de82556

Browse files
committed
Logger: Customize player colours for 3 and 4 player games
1 parent 60d7f40 commit de82556

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/games/logger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class LoggerGame extends GameBase {
4949
}
5050
],
5151
categories: ["goal>score>eog", "mechanic>place", "mechanic>move", "mechanic>block", "mechanic>share", "mechanic>capture", "board>shape>rect", "board>connect>rect", "components>pyramids"],
52-
flags: ["experimental", "scores", "no-moves", "custom-randomization", "perspective"]
52+
flags: ["experimental", "scores", "no-moves", "custom-randomization", "perspective", "custom-colours"]
5353
};
5454

5555
public static coords2algebraic(x: number, y: number): string {
@@ -1051,6 +1051,10 @@ export class LoggerGame extends GameBase {
10511051
return false;
10521052
}
10531053

1054+
public getPlayerColour(p: playerid): number | string {
1055+
return p > 2 ? p+1 : p;
1056+
}
1057+
10541058
public clone(): LoggerGame {
10551059
return Object.assign(new LoggerGame(this.numplayers), clone(this) as LoggerGame);
10561060
}

0 commit comments

Comments
 (0)