Release auction auto-pass with a personal player-card setting
This commit is contained in:
parent
22d4a0b80c
commit
3adad0cc0d
34 changed files with 609 additions and 10 deletions
27
docs/auction-auto-pass.md
Normal file
27
docs/auction-auto-pass.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# Auction auto-pass
|
||||
|
||||
Public-money games automatically pass players who cannot afford the next legal bid.
|
||||
With hidden money, each player can enable `autoPassBids`; it defaults to false. The
|
||||
setting is private, but the timing of a pass can reveal insufficient money, as the
|
||||
control's tooltip explains. The engine performs the passes even if the player is
|
||||
offline. The setting applies after the next committed move, not inside the host's
|
||||
settings-only persistence endpoint.
|
||||
|
||||
This covers normal and sealed auctions, and skipping a nomination when no plant is
|
||||
affordable. Exact-minimum sealed bids and Recharged's 1-Elektro discount remain
|
||||
available. Mandatory first-round purchases and plant/resource discards are never
|
||||
skipped. Automatic passes use normal move logs (hidden until resolution for sealed
|
||||
bids), timestamps and time increments. Historical replay does not re-evaluate
|
||||
today's settings or insert new passes.
|
||||
|
||||
Preview: build the engine and viewer, then run
|
||||
`node viewer/scripts/auction-preview.mjs` (default port 5216). The scenario selector
|
||||
offers public/hidden money and normal/sealed bidding. In the hidden-money preview,
|
||||
toggle the checkbox in your player card before pressing **Ada bids 10**.
|
||||
`/mobile` embeds the same interactive preview at phone width.
|
||||
|
||||
Published on BGS with engine 2.0.19 and viewer 2.3.15. Asset URLs and hashes are in
|
||||
[the release record](releases/auction-auto-pass-2.3.15.json). The declaration in
|
||||
`scripts/player-settings.json` is merged into BGS’s game `settings` list (not viewer
|
||||
preferences). Preserve other declared settings in future releases. The control uses
|
||||
the standard BGS `settings` / `update:setting` protocol, like Outpost.
|
||||
35
docs/releases/auction-auto-pass-2.3.15.json
Normal file
35
docs/releases/auction-auto-pass-2.3.15.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"game": "powergrid",
|
||||
"gameVersion": 13,
|
||||
"publishedAt": "2026-10-26T19:41:57.876Z",
|
||||
"engine": {
|
||||
"version": "2.0.19",
|
||||
"package": {
|
||||
"name": "powergrid-engine",
|
||||
"version": "2.0.19",
|
||||
"url": "https://s3.fr-par.scw.cloud/bgs-assets/games/powergrid/13/engine/cc7ee4928e2ecc14/powergrid-engine-2.0.19.tgz"
|
||||
},
|
||||
"entryPoint": "dist/wrapper.js",
|
||||
"sha256": "cc7ee4928e2ecc147c5d5e32d9fac7dcb7dd0b9a21df2db843e1a50914d484b9"
|
||||
},
|
||||
"viewer": {
|
||||
"version": "2.3.15",
|
||||
"url": "https://s3.fr-par.scw.cloud/bgs-assets/games/powergrid/13/viewer/split-5143d39a8cb7e66afe67/powergrid-viewer.umd.min.js",
|
||||
"stylesheets": [
|
||||
"https://s3.fr-par.scw.cloud/bgs-assets/games/powergrid/13/viewer/split-5143d39a8cb7e66afe67/powergrid-viewer.css"
|
||||
],
|
||||
"scriptBytes": 1219370,
|
||||
"sha256": "b1aa3081d783d5ef8930cd53f23b9a00a9b68c8693c9353ffc4eb25cfadd7cd5",
|
||||
"bundle": "split-5143d39a8cb7e66afe67",
|
||||
"files": 42
|
||||
},
|
||||
"settings": [
|
||||
{
|
||||
"name": "autoPassBids",
|
||||
"label": "Auto-pass auctions I cannot afford (always on with public money)",
|
||||
"type": "checkbox",
|
||||
"default": false
|
||||
}
|
||||
],
|
||||
"verified": true
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "powergrid-engine",
|
||||
"version": "2.0.18",
|
||||
"version": "2.0.19",
|
||||
"description": "An engine for Power Grid",
|
||||
"main": "dist/index.js",
|
||||
"types": "index.ts",
|
||||
|
|
|
|||
160
engine/src/auction-auto-pass.spec.ts
Normal file
160
engine/src/auction-auto-pass.spec.ts
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
import { expect } from 'chai';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import 'mocha';
|
||||
import * as wrapper from '../wrapper';
|
||||
import { autoPassAuctions } from './auction-auto-pass';
|
||||
import { availableMoves } from './available-moves';
|
||||
import { setup, stripSecret } from './engine';
|
||||
import { GameState, Phase } from './gamestate';
|
||||
import { Move, MoveName } from './move';
|
||||
import { powerPlants } from './powerPlants';
|
||||
|
||||
const json = (value: unknown) => JSON.parse(JSON.stringify(value));
|
||||
const pass: Move = { name: MoveName.Pass, data: true };
|
||||
function position(showMoney = true, fastBid = false): GameState {
|
||||
const G = setup(3, { map: 'Germany', variant: 'original', showMoney, fastBid }, 'auto-pass');
|
||||
G.round = 2;
|
||||
G.currentPlayers = [0];
|
||||
G.playerOrder = [0, 1, 2];
|
||||
G.players.forEach((p, i) => {
|
||||
p.money = [50, 10, 40][i];
|
||||
p.availableMoves = i === 0 ? availableMoves(G, p) : null;
|
||||
});
|
||||
return G;
|
||||
}
|
||||
const opening = (G: GameState, bid = 10): Move[] => [
|
||||
{ name: MoveName.ChoosePowerPlant, data: G.actualMarket[0].number },
|
||||
{ name: MoveName.Bid, data: bid },
|
||||
];
|
||||
|
||||
describe('authoritative auction auto-pass', () => {
|
||||
it('skips a public-money player who cannot raise, logs the pass and preserves an affordable next bidder', async () => {
|
||||
const G = await wrapper.move(position(), opening(position()), 0);
|
||||
expect(G.currentPlayers).to.deep.equal([2]);
|
||||
expect(G.players[1].passed).to.equal(true);
|
||||
expect(G.players[0].passed).to.equal(false);
|
||||
expect(G.log.slice(-1)[0]).to.include({ type: 'move', player: 1 });
|
||||
expect(G.players[2].availableMoves!.Bid![0]).to.equal(11);
|
||||
expect(wrapper.timeIncrements(G)).to.deep.equal([1, 1, 0]);
|
||||
expect(wrapper.toSave(G)).to.equal(G);
|
||||
const result = await wrapper.move(G, pass, 2);
|
||||
expect(result.players[0].money).to.equal(40);
|
||||
expect(result.players[0].powerPlants).to.have.length(1);
|
||||
});
|
||||
|
||||
it('leaves hidden money alone unless that player opted in; turning it off restores manual passing', async () => {
|
||||
const G = position(false);
|
||||
expect(wrapper.playerSettings(G, 1)).to.deep.equal({ autoPassBids: false });
|
||||
expect((await wrapper.move(cloneDeep(G), opening(G), 0)).currentPlayers).to.deep.equal([1]);
|
||||
wrapper.setPlayerSettings(G, 1, { autoPassBids: true });
|
||||
expect((await wrapper.move(cloneDeep(G), opening(G), 0)).currentPlayers).to.deep.equal([2]);
|
||||
wrapper.setPlayerSettings(G, 1, { autoPassBids: false });
|
||||
expect((await wrapper.move(G, opening(G), 0)).currentPlayers).to.deep.equal([1]);
|
||||
});
|
||||
|
||||
it('keeps settings private and strictly boolean', () => {
|
||||
const G = position(false);
|
||||
wrapper.setPlayerSettings(G, 1, { autoPassBids: true });
|
||||
expect(stripSecret(G, 0).players[1].settings).to.equal(undefined);
|
||||
expect(stripSecret(G).players[1].settings).to.equal(undefined);
|
||||
expect(stripSecret(G, 1).players[1].settings).to.deep.equal({ autoPassBids: true });
|
||||
wrapper.setPlayerSettings(G, 1, { autoPassBids: 'true' });
|
||||
expect(wrapper.playerSettings(G, 1)).to.deep.equal({ autoPassBids: false });
|
||||
});
|
||||
|
||||
it('never advances turns when the host saves settings', () => {
|
||||
const G = position(false);
|
||||
G.currentPlayers = [1];
|
||||
const before = json(G);
|
||||
wrapper.setPlayerSettings(G, 1, { autoPassBids: true });
|
||||
delete G.players[1].settings;
|
||||
expect(json(G)).to.deep.equal(before);
|
||||
});
|
||||
|
||||
for (const publicMoney of [true, false]) {
|
||||
it(`preserves sealed-bid privacy and permits an exact minimum bid (${
|
||||
publicMoney ? 'public' : 'opt-in'
|
||||
})`, async () => {
|
||||
let G = position(publicMoney, true);
|
||||
const minimum = G.actualMarket[0].number;
|
||||
G.players[1].money = minimum - 1;
|
||||
G.players[2].money = minimum;
|
||||
if (!publicMoney) wrapper.setPlayerSettings(G, 1, { autoPassBids: true });
|
||||
G = await wrapper.move(G, opening(G, minimum), 0);
|
||||
expect(G.currentPlayers).to.deep.equal([2]);
|
||||
expect(G.hiddenLog).to.have.length(2);
|
||||
expect(G.hiddenLog[1]).to.include({ player: 1 });
|
||||
expect(G.log.some((entry) => entry.type === 'move' && entry.player === 1)).to.equal(false);
|
||||
expect(stripSecret(G, 2).hiddenLog).to.have.length(0);
|
||||
expect(G.players[2].availableMoves!.Bid).to.deep.equal([minimum]);
|
||||
G = await wrapper.move(G, { name: MoveName.Bid, data: minimum }, 2);
|
||||
expect(G.hiddenLog).to.have.length(0);
|
||||
expect(G.players.reduce((n, p) => n + p.powerPlants.length, 0)).to.equal(1);
|
||||
});
|
||||
}
|
||||
|
||||
it('auto-skips nominations, but retains an affordable Recharged discount', () => {
|
||||
const G = position();
|
||||
G.players[0].money = 1;
|
||||
expect(autoPassAuctions(cloneDeep(G), 123).players[0].skipAuction).to.equal(true);
|
||||
G.options.variant = 'recharged';
|
||||
G.plantDiscountActive = true;
|
||||
const legal = availableMoves(G, G.players[0]);
|
||||
expect(legal.ChoosePowerPlant).to.deep.equal([G.actualMarket[0].number]);
|
||||
expect(autoPassAuctions(G, 123).currentPlayers).to.deep.equal([0]);
|
||||
});
|
||||
|
||||
it('uses the discounted minimum during bidding too', async () => {
|
||||
const G = position();
|
||||
G.options.variant = 'recharged';
|
||||
G.plantDiscountActive = true;
|
||||
G.players[1].money = 2;
|
||||
const result = await wrapper.move(G, opening(G, 1), 0);
|
||||
expect(result.currentPlayers).to.deep.equal([1]);
|
||||
expect(result.players[1].availableMoves!.Bid).to.deep.equal([2]);
|
||||
});
|
||||
|
||||
it('never bypasses plant discards or first-round mandatory buying', () => {
|
||||
const G = position();
|
||||
G.players[0].money = 0;
|
||||
G.players[0].powerPlants = cloneDeep(powerPlants.slice(0, 4));
|
||||
expect(autoPassAuctions(G, 123).players[0].skipAuction).to.equal(false);
|
||||
G.players[0].powerPlants = [];
|
||||
G.round = 1;
|
||||
expect(autoPassAuctions(G, 123).players[0].skipAuction).to.equal(false);
|
||||
});
|
||||
|
||||
it('does not infer unaffordability from stripped money', () => {
|
||||
const G = position();
|
||||
G.players[0].money = -1;
|
||||
expect(autoPassAuctions(G, 123).players[0].skipAuction).to.equal(false);
|
||||
});
|
||||
|
||||
for (const fastBid of [false, true]) {
|
||||
it(`replays logged auto-passes after settings change (${fastBid ? 'sealed' : 'open'})`, async () => {
|
||||
let G = setup(3, { map: 'Germany', variant: 'original', fastBid }, 'auto-pass-replay');
|
||||
const first = G.currentPlayers[0];
|
||||
const plant = G.actualMarket[0].number;
|
||||
for (const p of G.players) wrapper.setPlayerSettings(G, p.id, { autoPassBids: true });
|
||||
if (fastBid) {
|
||||
G = await wrapper.move(G, { name: MoveName.ChoosePowerPlant, data: plant }, first);
|
||||
// Normal setup has enough money for everyone; verify the old/manual
|
||||
// history remains manual even when all current settings are enabled.
|
||||
G = await wrapper.move(G, { name: MoveName.Bid, data: 50 }, first);
|
||||
G = await wrapper.move(G, pass, G.currentPlayers[0]);
|
||||
expect(json(wrapper.replay(G))).to.deep.equal(json(G));
|
||||
G = await wrapper.move(G, pass, G.currentPlayers[0]);
|
||||
} else G = await wrapper.move(G, opening(G, 50), first);
|
||||
for (const p of G.players) wrapper.setPlayerSettings(G, p.id, { autoPassBids: false });
|
||||
expect(G.players[first].powerPlants).to.have.length(1);
|
||||
expect(json(wrapper.replay(G))).to.deep.equal(json(G));
|
||||
});
|
||||
}
|
||||
|
||||
it('finishes an all-unaffordable auction phase without looping', () => {
|
||||
const G = position();
|
||||
G.players.forEach((p) => (p.money = 0));
|
||||
expect(autoPassAuctions(G, 123).phase).to.equal(Phase.Resources);
|
||||
expect(wrapper.timeIncrements(G)).to.deep.equal([1, 1, 1]);
|
||||
});
|
||||
});
|
||||
38
engine/src/auction-auto-pass.ts
Normal file
38
engine/src/auction-auto-pass.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { minimumPlantBid } from './auction-pricing';
|
||||
import { availableMoves } from './available-moves';
|
||||
import { move } from './engine';
|
||||
import { GameState, Phase } from './gamestate';
|
||||
import { MoveName } from './move';
|
||||
import { automation } from './premoves';
|
||||
|
||||
/** Authoritative live play only. Replays apply the resulting ordinary, logged Pass moves. */
|
||||
export function autoPassAuctions(G: GameState, serverTime: number): GameState {
|
||||
// Each seat can leave the current bidding, then skip its remaining nomination.
|
||||
// No plant is bought by this loop without an already submitted winning bid.
|
||||
for (let guard = 0; guard < G.players.length * 2 + 1 && G.phase === Phase.Auction; guard++) {
|
||||
const minimum = G.chosenPowerPlant
|
||||
? G.options.fastBid
|
||||
? G.minimunBid
|
||||
: G.currentBid != null
|
||||
? G.currentBid + 1
|
||||
: G.minimunBid
|
||||
: Math.min(...G.actualMarket.map((plant) => minimumPlantBid(G, plant)));
|
||||
const seat = G.currentPlayers.find((id) => {
|
||||
const player = G.players[id];
|
||||
if (!G.options.showMoney && player.settings?.autoPassBids !== true) return false;
|
||||
// Hidden/stripped states must never be used for an affordability decision.
|
||||
if (player.isDropped || player.money < 0 || player.money >= minimum) return false;
|
||||
const legal = availableMoves(G, player);
|
||||
return (
|
||||
!!legal.Pass?.length &&
|
||||
Object.entries(legal).every(([name, values]) => name === MoveName.Pass || !values?.length)
|
||||
);
|
||||
});
|
||||
if (seat === undefined) return G;
|
||||
G.players[seat].availableMoves = availableMoves(G, G.players[seat]);
|
||||
G = move(G, { name: MoveName.Pass, data: true, serverTime }, seat);
|
||||
automation(G).increments[seat]++;
|
||||
automation(G).liveUpdate = false;
|
||||
}
|
||||
return G;
|
||||
}
|
||||
8
engine/src/auction-pricing.ts
Normal file
8
engine/src/auction-pricing.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import type { GameState, PowerPlant } from './gamestate';
|
||||
|
||||
/** The Recharged discount also applies when deciding whether a plant can be nominated. */
|
||||
export function minimumPlantBid(G: GameState, plant: PowerPlant): number {
|
||||
return G.options.variant === 'recharged' && G.plantDiscountActive && plant.number === G.actualMarket[0]?.number
|
||||
? 1
|
||||
: plant.number;
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import { range } from 'lodash';
|
||||
import { minimumPlantBid } from './auction-pricing';
|
||||
import {
|
||||
countHeldPowerPlants,
|
||||
GameState,
|
||||
|
|
@ -179,7 +180,7 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
moves[MoveName.DiscardResources] = toDiscard;
|
||||
} else {
|
||||
if (G.chosenPowerPlant == undefined) {
|
||||
let canBid = G.actualMarket.filter((p) => player.money >= p.number);
|
||||
let canBid = G.actualMarket.filter((p) => player.money >= minimumPlantBid(G, p));
|
||||
|
||||
// No nuclear plants for Portugal
|
||||
if (G.map.name == 'Spain & Portugal') {
|
||||
|
|
|
|||
|
|
@ -657,6 +657,7 @@ export function stripSecret(G: GameState, player?: number): GameState {
|
|||
} else {
|
||||
return {
|
||||
...pl,
|
||||
settings: undefined,
|
||||
availableMoves: pl.availableMoves ? {} : null,
|
||||
money: ended(G) || G.options.showMoney ? pl.money : -1,
|
||||
bid: G.options.fastBid ? 0 : pl.bid,
|
||||
|
|
|
|||
|
|
@ -94,8 +94,14 @@ export interface CityPosition {
|
|||
position: number;
|
||||
}
|
||||
|
||||
export interface PlayerSettings {
|
||||
/** Opt in to revealing inability to afford an auction when money is hidden. */
|
||||
autoPassBids?: boolean;
|
||||
}
|
||||
|
||||
export interface Player {
|
||||
id: number;
|
||||
settings?: PlayerSettings;
|
||||
name?: string;
|
||||
powerPlants: PowerPlant[];
|
||||
coalCapacity: number;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { GameState } from './index';
|
||||
import { autoPassAuctions } from './src/auction-auto-pass';
|
||||
import { alreadyCreditedPowering, canReviseChoice } from './src/choice-revisions';
|
||||
import * as engine from './src/engine';
|
||||
import { playersSortedByScore } from './src/engine';
|
||||
|
|
@ -33,6 +34,26 @@ export function setPlayerMetaData(G: GameState, player: number, metaData: { name
|
|||
return G;
|
||||
}
|
||||
|
||||
export function setPlayerSettings(G: GameState, player: number, settings: Record<string, unknown>): GameState {
|
||||
if (G.players[player]) G.players[player].settings = { autoPassBids: settings.autoPassBids === true };
|
||||
// The host settings endpoint only persists preferences: it does not advance
|
||||
// turns or clocks. Apply automation after the next committed game move.
|
||||
return G;
|
||||
}
|
||||
|
||||
export function playerSettings(G: GameState, player: number): Record<string, unknown> {
|
||||
return { autoPassBids: G.players[player]?.settings?.autoPassBids === true };
|
||||
}
|
||||
|
||||
function runAutomaticMoves(G: GameState, now: number): GameState {
|
||||
// Premoves can finish upkeep and enter a new auction round; passing can enter
|
||||
// Resources. Settle both in order without re-running them inside replay.
|
||||
G = autoPassAuctions(G, now);
|
||||
G = runPremoves(G, now);
|
||||
G = autoPassAuctions(G, now);
|
||||
return runPremoves(G, now);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the current turn of `player` so far.
|
||||
*
|
||||
|
|
@ -57,7 +78,7 @@ export async function move(
|
|||
automation(G).liveUpdate = false;
|
||||
if (isPremoveCommand(move)) {
|
||||
setPremoves(G, move, player);
|
||||
return runPremoves(G, Date.now());
|
||||
return runAutomaticMoves(G, Date.now());
|
||||
}
|
||||
const initialPhase = G.phase;
|
||||
const initialRound = G.round;
|
||||
|
|
@ -108,7 +129,7 @@ export async function move(
|
|||
if (revision) automation(G).liveUpdate = true;
|
||||
else if (!alreadyCreditedPowering(G, player, initialPhase, initialRound)) automation(G).increments[player]++;
|
||||
reconcileManualPlan(G, player, initialPhase);
|
||||
if (!revision) G = runPremoves(G, now);
|
||||
G = revision ? autoPassAuctions(G, now) : runAutomaticMoves(G, now);
|
||||
}
|
||||
return G;
|
||||
}
|
||||
|
|
@ -149,7 +170,7 @@ export function moveAI(G: GameState, player: number): GameState {
|
|||
|
||||
if (G.newTurn !== false) {
|
||||
if (!alreadyCreditedPowering(G, player, initialPhase, initialRound)) automation(G).increments[player]++;
|
||||
return runPremoves(G, Date.now());
|
||||
return runAutomaticMoves(G, Date.now());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -200,6 +221,7 @@ export function replay(G: GameState, { to = Infinity }: { to?: number } = {}): G
|
|||
|
||||
for (let i = 0; i < oldPlayers.length && i < G.players.length; i++) {
|
||||
G.players[i].name = oldPlayers[i].name;
|
||||
G.players[i].settings = oldPlayers[i].settings ? { ...oldPlayers[i].settings } : undefined;
|
||||
}
|
||||
|
||||
// The visible log freezes during a fastBid auction: the simultaneous bids (and
|
||||
|
|
@ -288,7 +310,7 @@ export async function dropPlayer(G: GameState, playerNum: number): Promise<GameS
|
|||
// commit. Force the flag anyway (it costs nothing) so an unexpected auto-play path
|
||||
// can never leave the persisted state un-saveable.
|
||||
G.newTurn = true;
|
||||
return runPremoves(G, Date.now());
|
||||
return runAutomaticMoves(G, Date.now());
|
||||
}
|
||||
|
||||
export function currentPlayer(G: GameState): number[] {
|
||||
|
|
|
|||
8
scripts/player-settings.json
Normal file
8
scripts/player-settings.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[
|
||||
{
|
||||
"name": "autoPassBids",
|
||||
"label": "Auto-pass auctions I cannot afford (always on with public money)",
|
||||
"type": "checkbox",
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "powergrid-viewer",
|
||||
"version": "2.3.14",
|
||||
"version": "2.3.15",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/boardgamers/powergrid.git",
|
||||
|
|
|
|||
146
viewer/scripts/auction-preview.mjs
Normal file
146
viewer/scripts/auction-preview.mjs
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
// Local-only interactive preview. No BGS credentials, accounts or game writes.
|
||||
import { createServer } from 'node:http';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import { createRequire } from 'node:module';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
const require = createRequire(import.meta.url);
|
||||
const engine = require('../../engine/dist/index.js');
|
||||
const wrapper = require('../../engine/dist/wrapper.js');
|
||||
const { powerPlants } = require('../../engine/dist/src/powerPlants.js');
|
||||
const copy = (value) => JSON.parse(JSON.stringify(value));
|
||||
function position(mode) {
|
||||
const fastBid = mode.includes('sealed');
|
||||
const G = engine.setup(
|
||||
3,
|
||||
{ map: 'Germany', variant: 'original', showMoney: !mode.includes('hidden'), fastBid },
|
||||
'auction-preview'
|
||||
);
|
||||
G.round = 2;
|
||||
G.playerOrder = [2, 0, 1];
|
||||
G.currentPlayers = [2];
|
||||
const plant = (n) => copy(powerPlants.find((p) => p.number === n));
|
||||
G.actualMarket = (fastBid ? [17, 19, 20, 21] : [8, 10, 13, 15]).map(plant);
|
||||
G.futureMarket = [22, 23, 24, 25].map(plant);
|
||||
G.players.forEach((p, i) => {
|
||||
p.name = ['You', 'Leo', 'Ada'][i];
|
||||
p.money = [10, 40, 50][i];
|
||||
p.powerPlants = [plant([3, 4, 5][i])];
|
||||
p.availableMoves = null;
|
||||
});
|
||||
const visible = new Set(
|
||||
[...G.actualMarket, ...G.futureMarket, ...G.players.flatMap((p) => p.powerPlants)].map((p) => p.number)
|
||||
);
|
||||
G.powerPlantsDeck = G.powerPlantsDeck.filter((p) => !visible.has(p.number));
|
||||
G.cardsLeft = G.powerPlantsDeck.length;
|
||||
G.players[2].availableMoves = engine.availableMoves(G, G.players[2]);
|
||||
G.log.push({ type: 'event', event: 'Waiting for Ada to start an auction.' });
|
||||
G.newTurn = true;
|
||||
return G;
|
||||
}
|
||||
const states = new Map();
|
||||
const html = `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Power Grid · Auction auto-pass preview</title><link rel="stylesheet" href="/bundle.css"><style>body{margin:0;background:#e8ebdf;font-family:system-ui}.preview{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:#173b32;color:#fff;padding:10px 16px;font-size:13px}.preview button,.preview select{font:inherit;padding:7px}.preview a{color:white}.hint{font-size:13px;padding:8px 16px;margin:0;background:#edf1e8;color:#253b2c}#error{color:#9e1515}#error:empty{display:none}</style></head><body><header class="preview"><strong>Local preview</strong><select id="mode" aria-label="Auction scenario"><option value="public">Public money · open auction</option><option value="hidden">Hidden money · open auction</option><option value="public-sealed">Public money · sealed auction</option><option value="hidden-sealed">Hidden money · sealed auction</option></select><button id="opponent">Ada bids 10</button><button id="reset">Reset</button><a href="/mobile">Mobile preview</a></header><p class="hint">You have 10. With hidden money, try the auto-pass checkbox in your player card before Ada bids.</p><p id="error" role="alert"></p><div id="app"></div><script src="/vue.js"></script><script src="/bundle.js"></script><script>
|
||||
const query=new URLSearchParams(location.search),mode=query.get('mode')||'public';
|
||||
const host=window.host=powergrid.launch('#app');
|
||||
document.querySelector('#mode').value=mode;
|
||||
document.querySelector('#mode').onchange=e=>location.search='?mode='+e.target.value;
|
||||
async function send(path,body){const response=await fetch(path+'?mode='+mode,{method:body?'POST':'GET',headers:{'Content-Type':'application/json'},body:body?JSON.stringify(body):undefined});const data=await response.json();document.querySelector('#error').textContent=data.error||'';if(data.error)return;host.emit('settings',data.settings);host.emit('state',data.state);const button=document.querySelector('#opponent');button.textContent=data.next;button.disabled=!data.opponent;}
|
||||
host.on('fetchState',()=>send('/state'));host.on('move',move=>send('/move',{move}));host.on('update:setting',setting=>send('/setting',setting));
|
||||
host.emit('player',{index:0});host.emit('preferences',{sound:false,fitToScreen:true,locale:query.get('locale')||'en'});host.emit('chat:state',{canSend:false,mentions:[]});
|
||||
document.querySelector('#opponent').onclick=()=>send('/opponent',{});document.querySelector('#reset').onclick=()=>send('/reset',{});send('/state');
|
||||
</script></body></html>`;
|
||||
export function auctionPreviewServer() {
|
||||
return createServer(async (req, res) => {
|
||||
const url = new URL(req.url, 'http://localhost');
|
||||
const mode = url.searchParams.get('mode') || 'public';
|
||||
res.setHeader('Cache-Control', 'no-store');
|
||||
try {
|
||||
if (url.pathname === '/mobile') {
|
||||
res.setHeader('Content-Type', 'text/html');
|
||||
return res.end(
|
||||
'<!doctype html><meta name="viewport" content="width=device-width,initial-scale=1"><title>Power Grid · Mobile auction preview</title><style>body{margin:0;background:#202b24;display:grid;justify-content:center}iframe{width:390px;max-width:100vw;height:100dvh;border:0}</style><iframe title="Mobile auction preview" src="/?mode=hidden"></iframe>'
|
||||
);
|
||||
}
|
||||
const files = {
|
||||
'/bundle.js': new URL('../dist/powergrid-viewer.umd.min.js', import.meta.url),
|
||||
'/bundle.css': new URL('../dist/powergrid-viewer.css', import.meta.url),
|
||||
'/vue.js': require.resolve('vue/dist/vue.min.js'),
|
||||
};
|
||||
if (/^\/powergrid-viewer\.umd\.min\.(?:locale-[a-zA-Z-]+|geography-[a-z-]+)\.js$/.test(url.pathname))
|
||||
files[url.pathname] = new URL('../dist' + url.pathname, import.meta.url);
|
||||
if (url.pathname === '/' || files[url.pathname]) {
|
||||
res.setHeader(
|
||||
'Content-Type',
|
||||
url.pathname.endsWith('.js')
|
||||
? 'text/javascript'
|
||||
: url.pathname.endsWith('.css')
|
||||
? 'text/css'
|
||||
: 'text/html'
|
||||
);
|
||||
return res.end(files[url.pathname] ? await readFile(files[url.pathname]) : html);
|
||||
}
|
||||
if (!states.has(mode)) states.set(mode, position(mode));
|
||||
let state = states.get(mode);
|
||||
if (req.method === 'POST') {
|
||||
let raw = '';
|
||||
for await (const part of req) raw += part;
|
||||
const body = JSON.parse(raw || '{}');
|
||||
if (url.pathname === '/reset') state = position(mode);
|
||||
else if (url.pathname === '/setting')
|
||||
state = wrapper.setPlayerSettings(copy(state), 0, { [body.name]: body.value });
|
||||
else if (url.pathname === '/move') {
|
||||
if (!state.currentPlayers.includes(0) && !wrapper.canMoveOutOfTurn(state, body.move, 0))
|
||||
throw Error('Not your turn.');
|
||||
const result = await wrapper.move(copy(state), body.move, 0);
|
||||
if (!wrapper.toSave(result)) {
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
return res.end(
|
||||
JSON.stringify({
|
||||
state: wrapper.stripSecret(result, 0),
|
||||
settings: wrapper.playerSettings(state, 0),
|
||||
next: 'Your turn',
|
||||
opponent: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
state = result;
|
||||
} else if (url.pathname === '/opponent') {
|
||||
const seat = state.currentPlayers.find((p) => p !== 0);
|
||||
if (seat === undefined) throw Error('It is your turn.');
|
||||
if (state.phase === engine.Phase.Auction && !state.chosenPowerPlant && seat === 2) {
|
||||
state = await wrapper.move(
|
||||
copy(state),
|
||||
[
|
||||
{ name: 'ChoosePowerPlant', data: state.actualMarket[0].number },
|
||||
{ name: 'Bid', data: state.options.fastBid ? 17 : 10 },
|
||||
],
|
||||
seat
|
||||
);
|
||||
} else state = await wrapper.move(copy(state), { name: 'Pass', data: true }, seat);
|
||||
}
|
||||
states.set(mode, state);
|
||||
}
|
||||
const opponent = state.currentPlayers.find((p) => p !== 0);
|
||||
res.setHeader('Content-Type', 'application/json');
|
||||
res.end(
|
||||
JSON.stringify({
|
||||
state: wrapper.stripSecret(state, 0),
|
||||
settings: wrapper.playerSettings(state, 0),
|
||||
opponent: opponent !== undefined,
|
||||
next:
|
||||
opponent === undefined
|
||||
? 'Your turn'
|
||||
: state.chosenPowerPlant || state.phase !== engine.Phase.Auction
|
||||
? state.players[opponent].name + ' passes'
|
||||
: 'Ada bids ' + (state.options.fastBid ? 17 : 10),
|
||||
})
|
||||
);
|
||||
} catch (error) {
|
||||
res.writeHead(422, { 'Content-Type': 'application/json' });
|
||||
res.end(JSON.stringify({ error: error.message }));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (process.argv[1] === fileURLToPath(import.meta.url))
|
||||
auctionPreviewServer().listen(Number(process.env.PORT || 5216), '127.0.0.1', () =>
|
||||
console.log('Auction preview: http://127.0.0.1:' + (process.env.PORT || 5216))
|
||||
);
|
||||
|
|
@ -551,7 +551,7 @@
|
|||
<PlayerBoard
|
||||
:key="'B' + playerIndex"
|
||||
:transform="`translate(${G.map.playerBoardsPosition[0]}, ${
|
||||
G.map.playerBoardsPosition[1] + 110 * i
|
||||
G.map.playerBoardsPosition[1] + playerBoardOffset(i)
|
||||
})`"
|
||||
:player="G.players[playerIndex]"
|
||||
:color="playerColors[playerIndex]"
|
||||
|
|
@ -565,6 +565,11 @@
|
|||
:showBid="!G.options.fastBid"
|
||||
:phase="G.phase"
|
||||
:isAustralia="G.map.name === 'Australia'"
|
||||
:showAutoPass="player == playerIndex && showAutoPass"
|
||||
:autoPass="!!G.options.showMoney || !!(settings && settings.autoPassBids)"
|
||||
:autoPassPublic="!!G.options.showMoney"
|
||||
:autoPassDisabled="!canEditAuctionSettings"
|
||||
@toggleAutoPass="toggleAutoPass()"
|
||||
@powerPlantClick="powerPlantClick($event)"
|
||||
@discardResource="discardResource($event)"
|
||||
/>
|
||||
|
|
@ -960,7 +965,7 @@ import { bidRevision, canReopenPowering } from 'powergrid-engine/src/choice-revi
|
|||
import { availableMoves, canStoreFuel } from 'powergrid-engine/src/available-moves';
|
||||
import { powerIncome, updatePlayerCapacity } from 'powergrid-engine/src/engine';
|
||||
import { inactiveMapNetwork } from '../util/inactive-map';
|
||||
import { desktopBoardLayout } from '../util/board-layout';
|
||||
import { desktopBoardLayout, PLAYER_SETTING_ROW_HEIGHT } from '../util/board-layout';
|
||||
import { measureBoardBox } from '../util/measure-board';
|
||||
import type { BoardBox } from '../util/board-layout';
|
||||
|
||||
|
|
@ -1132,6 +1137,34 @@ export default class Game extends Vue {
|
|||
@Prop({ default: false })
|
||||
undoAvailable!: boolean;
|
||||
|
||||
@Prop({ default: null })
|
||||
settings!: Record<string, unknown> | null;
|
||||
|
||||
get showAutoPass(): boolean {
|
||||
return (
|
||||
!this.tutorialMove &&
|
||||
!this.preferences.analysis &&
|
||||
this.player != null &&
|
||||
!!this.G?.players[this.player] &&
|
||||
(!!this.G.options.showMoney || this.settings !== null)
|
||||
);
|
||||
}
|
||||
get canEditAuctionSettings(): boolean {
|
||||
return (
|
||||
this.showAutoPass &&
|
||||
!this.G?.options.showMoney &&
|
||||
this.settings !== null &&
|
||||
!this.paused &&
|
||||
!this.roundPlan &&
|
||||
!this.interactionDisabled &&
|
||||
!this.gameIsOver
|
||||
);
|
||||
}
|
||||
toggleAutoPass() {
|
||||
if (this.canEditAuctionSettings)
|
||||
this.emitter.emit('update:setting', { name: 'autoPassBids', value: !this.settings?.autoPassBids });
|
||||
}
|
||||
|
||||
@Prop()
|
||||
@ProvideReactive()
|
||||
preferences!: Preferences;
|
||||
|
|
@ -3008,6 +3041,7 @@ export default class Game extends Vue {
|
|||
map: this.G?.map,
|
||||
players: this.G?.players.length,
|
||||
locale: this.preferences.locale,
|
||||
auctionSettings: this.showAutoPass,
|
||||
});
|
||||
if (!this.shouldStack() && !this.stacked && desktopKey === this.desktopLayoutKey) return;
|
||||
|
||||
|
|
@ -3237,6 +3271,7 @@ export default class Game extends Vue {
|
|||
@Watch('G')
|
||||
@Watch('layoutPreferencesKey')
|
||||
@Watch('hasPlanPanel')
|
||||
@Watch('showAutoPass')
|
||||
onSceneContentChanged() {
|
||||
this.scheduleRelayout();
|
||||
}
|
||||
|
|
@ -3245,6 +3280,12 @@ export default class Game extends Vue {
|
|||
return playerOrderForDisplay(this.G, this.preferences.adjustPlayerOrder);
|
||||
}
|
||||
|
||||
playerBoardOffset(index: number): number {
|
||||
const ownIndex = this.player == null ? -1 : this.adjustedPlayerOrder.indexOf(this.player);
|
||||
const extraHeight = this.showAutoPass && ownIndex >= 0 && ownIndex < index ? PLAYER_SETTING_ROW_HEIGHT : 0;
|
||||
return 110 * index + extraHeight;
|
||||
}
|
||||
|
||||
get uraniumMineRemoval(): number | undefined {
|
||||
if (!this.G || !this.G.uraniumMineMarket || !this.G.map.uraniumMineResupply) return undefined;
|
||||
const step = this.stacked ? this.G.step : this.displayedResupplyStep;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<g class="player-board">
|
||||
<rect width="350" height="100" x="0" y="0" fill="gold" :stroke="color" />
|
||||
<rect width="350" :height="100 + (showAutoPass ? settingRowHeight : 0)" x="0" y="0" fill="gold" :stroke="color" />
|
||||
<rect width="350" height="25" x="0" y="0" :fill="color" />
|
||||
<foreignObject height="30" width="30" x="-30" y="-5">
|
||||
<img
|
||||
|
|
@ -36,6 +36,33 @@
|
|||
>Money: ${{ player.money }}</text
|
||||
>
|
||||
|
||||
<!-- Keep the full preference inside the viewer's own player card. -->
|
||||
<template v-if="showAutoPass">
|
||||
<g
|
||||
class="auction-auto-pass"
|
||||
:class="{ editable: !autoPassDisabled }"
|
||||
transform="translate(0, 100)"
|
||||
data-auction-auto-pass
|
||||
:role="autoPassPublic ? 'note' : 'checkbox'"
|
||||
:aria-checked="autoPassPublic ? undefined : String(autoPass)"
|
||||
:aria-disabled="autoPassDisabled ? 'true' : 'false'"
|
||||
:tabindex="autoPassPublic || autoPassDisabled ? -1 : 0"
|
||||
aria-label="Auto-pass if unaffordable"
|
||||
@click="!autoPassDisabled && $emit('toggleAutoPass')"
|
||||
@keydown.enter.prevent="!autoPassDisabled && $emit('toggleAutoPass')"
|
||||
@keydown.space.prevent="!autoPassDisabled && $emit('toggleAutoPass')"
|
||||
>
|
||||
<rect class="auto-pass-hit" width="350" :height="settingRowHeight" fill="transparent" />
|
||||
<path d="M0 0H350" stroke="#806b28" stroke-opacity="0.35" />
|
||||
<rect x="10" y="9" width="18" height="18" rx="2" :fill="autoPass ? '#304b3b' : '#f5f4e5'" stroke="#304b3b" />
|
||||
<path v-if="autoPass" d="M14 18L18 22L24 14" fill="none" stroke="white" stroke-width="2" />
|
||||
<text x="37" y="18" fill="#24382b" style="font: 16px Arial, sans-serif; dominant-baseline: central">Auto-pass if unaffordable</text>
|
||||
<title>{{ autoPassPublic
|
||||
? 'Money is public: players automatically pass auctions they cannot afford.'
|
||||
: 'Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.' }}</title>
|
||||
</g>
|
||||
</template>
|
||||
|
||||
<Card
|
||||
v-for="(powerPlant, i) in player.powerPlants"
|
||||
:key="'powerPlant_' + powerPlant.number"
|
||||
|
|
@ -173,6 +200,7 @@ import { Phase, playerTimeUsed, PowerPlant, PowerPlantType, ResourceType } from
|
|||
import { Vue, Component, Prop, Inject } from 'vue-property-decorator';
|
||||
import { Preferences } from '../types/ui-data';
|
||||
import { formatDuration } from '../util/time';
|
||||
import { PLAYER_SETTING_ROW_HEIGHT } from '../util/board-layout';
|
||||
import { Coal, Oil, Garbage, Uranium, Card } from './pieces';
|
||||
|
||||
@Component({
|
||||
|
|
@ -199,6 +227,12 @@ export default class PlayerBoard extends Vue {
|
|||
@Prop() phase?: Phase;
|
||||
// Australia: uranium plants are "mines" — flag so the hand marks them distinctly.
|
||||
@Prop() isAustralia?: boolean;
|
||||
@Prop({ default: false }) showAutoPass!: boolean;
|
||||
@Prop({ default: false }) autoPass!: boolean;
|
||||
@Prop({ default: false }) autoPassPublic!: boolean;
|
||||
@Prop({ default: true }) autoPassDisabled!: boolean;
|
||||
|
||||
settingRowHeight = PLAYER_SETTING_ROW_HEIGHT;
|
||||
|
||||
@Inject() preferences!: Preferences;
|
||||
|
||||
|
|
@ -376,3 +410,9 @@ export default class PlayerBoard extends Vue {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.auction-auto-pass.editable { cursor: pointer; }
|
||||
.auction-auto-pass.editable:hover .auto-pass-hit { fill: #ffffff30; }
|
||||
.auction-auto-pass:focus { outline: none; }
|
||||
.auction-auto-pass:focus-visible .auto-pass-hit { stroke: currentColor; stroke-width: 2; }
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ function launch(selector: string) {
|
|||
preferences: Preferences;
|
||||
avatars: string[];
|
||||
undoAvailable: boolean;
|
||||
settings: Record<string, unknown> | null;
|
||||
} = {
|
||||
state: null,
|
||||
emitter: new EventEmitter(),
|
||||
|
|
@ -52,6 +53,7 @@ function launch(selector: string) {
|
|||
}),
|
||||
avatars: [],
|
||||
undoAvailable: false,
|
||||
settings: null,
|
||||
};
|
||||
|
||||
const app = new Vue({
|
||||
|
|
@ -77,6 +79,10 @@ function launch(selector: string) {
|
|||
params.player = data.index;
|
||||
app.$forceUpdate();
|
||||
},
|
||||
onSettings(settings) {
|
||||
params.settings = settings;
|
||||
app.$forceUpdate();
|
||||
},
|
||||
async onPreferences(data) {
|
||||
if (!(await localization.setLocale(data.locale))) return;
|
||||
Object.assign(params.preferences, data);
|
||||
|
|
@ -132,6 +138,12 @@ function launch(selector: string) {
|
|||
params.emitter.on('replaceLog', (data: string[]) => viewer.replaceLog(data));
|
||||
params.emitter.on('replay:info', (info) => viewer.setReplayInfo(info));
|
||||
params.emitter.on('update:preference', ({ name, value }) => viewer.updatePreference(name, value));
|
||||
params.emitter.on('update:setting', ({ name, value }) => {
|
||||
if (viewer.updateSetting(name, value)) {
|
||||
params.settings = { ...params.settings, [name]: value };
|
||||
app.$forceUpdate();
|
||||
}
|
||||
});
|
||||
params.emitter.on('undo', () => viewer.undo());
|
||||
installActionSounds(item);
|
||||
const removeCards = installPlayerCards(app.$el, viewer);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Auto-pas, hvis pengene ikke rækker",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Pengene er offentlige: Spillere passer automatisk i auktioner, de ikke har råd til.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Passer automatisk i auktioner, du ikke har råd til. Med skjulte penge kan det afsløre, at du ikke har råd til buddet. Gælder efter næste træk.",
|
||||
"Show unselected regions": "Vis ikke-valgte regioner",
|
||||
"Color-blind mode": "Farveblind-tilstand",
|
||||
"\" not found for variant \"": "\" ikke fundet for variant \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Automatisch passen bei Geldmangel",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Das Geld ist öffentlich: Spieler passen automatisch bei Auktionen, die sie sich nicht leisten können.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Automatisch bei Auktionen passen, die du dir nicht leisten kannst. Bei verdecktem Geld kann dies verraten, dass du dir das Gebot nicht leisten kannst. Gilt nach dem nächsten Zug.",
|
||||
"Show unselected regions": "Nicht ausgewählte Regionen anzeigen",
|
||||
"Color-blind mode": "Modus für Farbenblindheit",
|
||||
"\" not found for variant \"": "„ nicht gefunden für Variante „",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Αυτόματο πάσο χωρίς αρκετά χρήματα",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Τα χρήματα είναι φανερά: Οι παίκτες κάνουν αυτόματα πάσο όταν δεν μπορούν να πληρώσουν την προσφορά.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Αυτόματο πάσο σε δημοπρασίες που δεν μπορείς να πληρώσεις. Με κρυφά χρήματα, αυτό μπορεί να αποκαλύψει ότι δεν έχεις αρκετά για την προσφορά. Ισχύει μετά την επόμενη κίνηση.",
|
||||
"Show unselected regions": "Εμφάνιση μη επιλεγμένων περιοχών",
|
||||
"Color-blind mode": "Λειτουργία για αχρωματοψία",
|
||||
"\" not found for variant \"": "\" δεν βρέθηκε για την παραλλαγή \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Auto-pass if unaffordable",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Money is public: players automatically pass auctions they cannot afford.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.",
|
||||
"Show unselected regions": "Show unselected regions",
|
||||
"Color-blind mode": "Color-blind mode",
|
||||
"\" not found for variant \"": "\" not found for variant \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "پاس خودکار با پول ناکافی",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "پولها آشکارند: بازیکنان در مزایدههایی که پول کافی ندارند، خودکار پاس میدهند.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "در مزایدههایی که پول کافی نداری، خودکار پاس بده. با پول مخفی، این کار ممکن است نشان دهد که توان پرداخت پیشنهاد را نداری. پس از حرکت بعدی اعمال میشود.",
|
||||
"Show unselected regions": "نمایش مناطق انتخابنشده",
|
||||
"Color-blind mode": "حالت کوررنگی",
|
||||
"\" not found for variant \"": "» برای نسخهٔ « پیدا نشد",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Passer si l’argent ne suffit pas",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "L’argent est visible : les joueurs passent automatiquement les enchères qu’ils ne peuvent pas payer.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Passer automatiquement les enchères que vous ne pouvez pas payer. Avec l’argent caché, cela peut révéler que vos fonds sont insuffisants. S’applique après le prochain coup.",
|
||||
"Show unselected regions": "Afficher les régions non sélectionnées",
|
||||
"Color-blind mode": "Mode daltonien",
|
||||
"\" not found for variant \"": "\" introuvable pour la variante \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "पैसे कम हों तो अपने-आप पास",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "पैसा खुला है: खिलाड़ी उन नीलामियों में अपने-आप पास करते हैं जिनकी बोली वे नहीं चुका सकते।",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "जिन नीलामियों की बोली आप नहीं चुका सकते, उनमें अपने-आप पास करें। पैसा छिपा होने पर इससे पता चल सकता है कि आपके पास बोली के लिए पर्याप्त पैसे नहीं हैं। अगली चाल के बाद लागू होगा।",
|
||||
"Show unselected regions": "न चुने गए क्षेत्र दिखाएँ",
|
||||
"Color-blind mode": "रंग-अंधता मोड",
|
||||
"\" not found for variant \"": "\" वैरिएंट के लिए नहीं मिला \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Passa se i soldi non bastano",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Il denaro è pubblico: i giocatori passano automaticamente nelle aste che non possono permettersi.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Passa automaticamente nelle aste che non puoi permetterti. Con denaro nascosto, questo può rivelare che non puoi permetterti l’offerta. Si applica dopo la prossima mossa.",
|
||||
"Show unselected regions": "Mostra le regioni non selezionate",
|
||||
"Color-blind mode": "Modalità daltonici",
|
||||
"\" not found for variant \"": "\" non trovato per la variante \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "자금 부족 시 자동 패스",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "자금이 공개되어 있습니다. 입찰할 돈이 부족한 플레이어는 자동으로 패스합니다.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "입찰할 돈이 부족하면 자동으로 패스합니다. 자금이 비공개일 때는 입찰 금액을 감당할 수 없다는 사실이 드러날 수 있습니다. 다음 행동 이후 적용됩니다.",
|
||||
"Show unselected regions": "선택하지 않은 지역 표시",
|
||||
"Color-blind mode": "색각 이상 모드",
|
||||
"\" not found for variant \"": "\" 변형에 대해 찾을 수 없음 \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Automatisch passen bij geldtekort",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Geld is openbaar: spelers passen automatisch bij veilingen die ze niet kunnen betalen.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Pas automatisch bij veilingen die je niet kunt betalen. Bij verborgen geld kan dit onthullen dat je het bod niet kunt betalen. Geldt na de volgende zet.",
|
||||
"Show unselected regions": "Niet-geselecteerde regio’s tonen",
|
||||
"Color-blind mode": "Modus voor kleurenblindheid",
|
||||
"\" not found for variant \"": "\" niet gevonden voor variant \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Pasuj automatycznie bez środków",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Pieniądze są jawne: gracze automatycznie pasują w aukcjach, na które ich nie stać.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Automatycznie pasuj w aukcjach, na które Cię nie stać. Przy ukrytych pieniądzach może to ujawnić, że nie stać Cię na ofertę. Działa po następnym ruchu.",
|
||||
"Show unselected regions": "Pokaż niewybrane regiony",
|
||||
"Color-blind mode": "Tryb dla daltonistów",
|
||||
"\" not found for variant \"": "\" nie znaleziono dla wariantu \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Passar se o dinheiro não bastar",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "O dinheiro é público: jogadores passam automaticamente em leilões que não podem pagar.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Passe automaticamente em leilões que você não pode pagar. Com dinheiro oculto, isso pode revelar que você não pode pagar o lance. Vale após a próxima jogada.",
|
||||
"Show unselected regions": "Mostrar regiões não selecionadas",
|
||||
"Color-blind mode": "Modo daltônico",
|
||||
"\" not found for variant \"": "\" não encontrado para a variante \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Pas automat dacă nu ai bani",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Banii sunt publici: jucătorii spun automat pas la licitațiile pe care nu și le permit.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Spune automat pas la licitațiile pe care nu ți le permiți. Cu bani ascunși, asta poate dezvălui că nu îți permiți oferta. Se aplică după următoarea mutare.",
|
||||
"Show unselected regions": "Arată regiunile neselectate",
|
||||
"Color-blind mode": "Mod pentru daltoniști",
|
||||
"\" not found for variant \"": "\" nu a fost găsit pentru varianta \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Автопас при нехватке денег",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Деньги открыты: игроки автоматически пасуют на аукционах, если не могут оплатить ставку.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Автоматически пасовать на аукционах, если не хватает денег. При скрытых деньгах это может показать, что вы не можете оплатить ставку. Применяется после следующего хода.",
|
||||
"Show unselected regions": "Показать невыбранные регионы",
|
||||
"Color-blind mode": "Режим для дальтоников",
|
||||
"\" not found for variant \"": "\" не найдено для варианта \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "Tự động bỏ lượt nếu thiếu tiền",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "Tiền được công khai: người chơi tự động bỏ lượt đấu giá nếu không đủ tiền.",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "Tự động bỏ lượt đấu giá nếu bạn không đủ tiền. Khi tiền được giữ kín, điều này có thể tiết lộ rằng bạn không đủ tiền trả giá. Áp dụng sau nước đi tiếp theo.",
|
||||
"Show unselected regions": "Hiển thị các vùng chưa được chọn",
|
||||
"Color-blind mode": "Chế độ mù màu",
|
||||
"\" not found for variant \"": "\" không tìm thấy cho biến thể \"",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "资金不足时自动放弃竞价",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "资金公开:玩家在无力支付出价时自动放弃竞价。",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "在无力支付出价时自动放弃竞价。资金隐藏时,这可能暴露你无力支付该出价。下次行动后生效。",
|
||||
"Show unselected regions": "显示未选地区",
|
||||
"Color-blind mode": "色盲模式",
|
||||
"\" not found for variant \"": "”在此变体中未找到:“",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"Auto-pass if unaffordable": "資金不足時自動放棄競價",
|
||||
"Money is public: players automatically pass auctions they cannot afford.": "資金公開:玩家在無力支付出價時自動放棄競價。",
|
||||
"Automatically pass auctions you cannot afford. With hidden money, this can reveal that you cannot afford the bid. Applies after the next move.": "在無力支付出價時自動放棄競價。資金隱藏時,這可能暴露你無力支付該出價。下次行動後生效。",
|
||||
"Show unselected regions": "顯示未選取的區域",
|
||||
"Color-blind mode": "色盲模式",
|
||||
"\" not found for variant \"": "」未找到,用於變體「",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
/** Extra room for the current player's full-width auction preference. */
|
||||
export const PLAYER_SETTING_ROW_HEIGHT = 36;
|
||||
|
||||
export interface BoardBox {
|
||||
x: number;
|
||||
y: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue