✨ (engine) Expose player colors to BGS
This commit is contained in:
parent
3632b8189d
commit
297815defa
2 changed files with 5 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ import { GameEventName, LogItem } from './log';
|
|||
import { Move, MoveName, Moves } from './move';
|
||||
import { asserts, shuffle } from './utils';
|
||||
|
||||
const playerColors = ['dodgerblue', 'red', 'yellow', 'limegreen', 'mediumorchid'];
|
||||
export const playerColors = ['dodgerblue', 'red', 'yellow', 'limegreen', 'mediumorchid'];
|
||||
|
||||
export function setup(numPlayers: number, { beginner = true }: GameOptions, seed?: string): GameState {
|
||||
seed = seed ?? Math.random().toString();
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ export async function move(G: GameState, move: Move, player: number) {
|
|||
return G;
|
||||
}
|
||||
|
||||
export function factions(G: GameState) {
|
||||
return G.players.map((pl) => engine.playerColors[pl.id]);
|
||||
}
|
||||
|
||||
export { ended, scores, stripSecret } from './src/engine';
|
||||
|
||||
export function rankings(G: GameState) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue