powergrid-viewer 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/self-contained.ts
CHANGED
|
@@ -10,30 +10,27 @@ function launchSelfContained(selector = '#app') {
|
|
|
10
10
|
|
|
11
11
|
const emitter = launch(selector);
|
|
12
12
|
|
|
13
|
-
let gameState = setup(
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// gameState.map.
|
|
21
|
-
// gameState.map.
|
|
22
|
-
// gameState.map.
|
|
23
|
-
// gameState.map.supplyPosition = [0, 720];
|
|
24
|
-
|
|
13
|
+
let gameState = setup(5, { map: 'UK & Ireland', variant: 'recharged', showMoney: true, randomizeMap: false }, '7');
|
|
14
|
+
|
|
15
|
+
// Dev coord-picker example (commented; uncomment + drop a board photo into
|
|
16
|
+
// viewer/public/ to author city coordinates for a new map). See the picker
|
|
17
|
+
// notes in CLAUDE/memory or in the engine map-authoring docs.
|
|
18
|
+
//
|
|
19
|
+
// import { map as fullMap } from 'powergrid-engine/src/maps/southafrica';
|
|
20
|
+
// gameState.map.cities = fullMap.cities.map((c) => ({ ...c }));
|
|
21
|
+
// gameState.map.connections = fullMap.connections.map((c) => ({ ...c, nodes: [...c.nodes] }));
|
|
22
|
+
// gameState.map.devBackdrop = { src: '/southafrica.jpg', width: 1200, height: 863, opacity: 0.5 };
|
|
25
23
|
// gameState.map.adjustRatio = [1, 1];
|
|
26
|
-
// gameState.map.
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
// gameState.map.
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
// }));
|
|
24
|
+
// gameState.map.mapRotation = 0;
|
|
25
|
+
// gameState.map.mapPosition = [0, 0];
|
|
26
|
+
// gameState.map.viewBox = [1200, 863];
|
|
27
|
+
// gameState.map.playerBoardsPosition = [-9999, -9999];
|
|
28
|
+
// gameState.map.powerPlantMarketPosition = [-9999, -9999];
|
|
29
|
+
// gameState.map.buttonsPosition = [-9999, -9999];
|
|
30
|
+
// gameState.map.supplyPosition = [-9999, -9999];
|
|
31
|
+
// gameState.map.roundInfoPosition = [-9999, -9999];
|
|
32
|
+
// gameState.map.cityCountPosition = [-9999, -9999];
|
|
33
|
+
// gameState.map.playerOrderPosition = [-9999, -9999];
|
|
37
34
|
|
|
38
35
|
for (let i = 0; i < gameState.players.length; i++) {
|
|
39
36
|
gameState.players[i].name = `Player ${i + 1}`;
|
package/src/types/ui-data.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface Piece {
|
|
|
21
21
|
color?: string;
|
|
22
22
|
powerPlant?: PowerPlant;
|
|
23
23
|
transparent?: boolean;
|
|
24
|
+
side?: 'north' | 'south';
|
|
25
|
+
// South Africa: this coal cube sits in the storage pool below the market.
|
|
26
|
+
// Clicking emits buyResource with fromStorage:true (flat $8 buy).
|
|
27
|
+
fromStorage?: boolean;
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export enum PieceType {
|