powergrid-viewer 1.9.0 → 1.9.2
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/dist/powergrid-viewer.umd.min.js +4 -4
- package/package.json +2 -2
- package/src/components/Game.vue +10 -0
- package/src/components/boards/Map.vue +11 -1
- package/src/components/boards/PowerPlantMarket.vue +5 -2
- package/src/components/boards/Resources.vue +37 -0
- package/src/self-contained.ts +1 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powergrid-viewer",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/boardgamers/powergrid.git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"vue": "^2.6.11",
|
|
19
19
|
"vue-class-component": "^7.2.3",
|
|
20
20
|
"vue-property-decorator": "^8.4.2",
|
|
21
|
-
"powergrid-engine": "1.13.
|
|
21
|
+
"powergrid-engine": "1.13.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/assert": "^1.4.7",
|
package/src/components/Game.vue
CHANGED
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
:buyableResources="buyableResources()"
|
|
72
72
|
:coalStorage="G.coalStorage"
|
|
73
73
|
:resourceResupply="getResourceResupply()"
|
|
74
|
+
:resourceResupplyNorth="getResourceResupplyNorth()"
|
|
74
75
|
@buyResource="buyResource($event)"
|
|
75
76
|
/>
|
|
76
77
|
|
|
@@ -1140,6 +1141,15 @@ export default class Game extends Vue {
|
|
|
1140
1141
|
|
|
1141
1142
|
return [0, 0, 0, 0];
|
|
1142
1143
|
}
|
|
1144
|
+
|
|
1145
|
+
getResourceResupplyNorth() {
|
|
1146
|
+
if (this.G && this.G.resourceResupplyNorth) {
|
|
1147
|
+
let str = this.G.resourceResupplyNorth[this.G.step - 1];
|
|
1148
|
+
str = str.substr(1, str.length - 2);
|
|
1149
|
+
return str.split(',');
|
|
1150
|
+
}
|
|
1151
|
+
return null;
|
|
1152
|
+
}
|
|
1143
1153
|
}
|
|
1144
1154
|
</script>
|
|
1145
1155
|
<style lang="scss">
|
|
@@ -225,7 +225,17 @@ export default class Map extends Vue {
|
|
|
225
225
|
player.cities.forEach((cityPiece) => {
|
|
226
226
|
const city = gameState.map.cities.find((city) => city.name == cityPiece.name)!;
|
|
227
227
|
let offsetX, offsetY;
|
|
228
|
-
|
|
228
|
+
const is1520 = city.slotCosts?.length === 2 && city.slotCosts[0] === 15;
|
|
229
|
+
if (is1520) {
|
|
230
|
+
// [15,20] city: slot 0 (cost 15) → bottom-left, slot 1 (cost 20) → bottom-right
|
|
231
|
+
if (cityPiece.position == 0) {
|
|
232
|
+
offsetX = -15;
|
|
233
|
+
offsetY = -4;
|
|
234
|
+
} else {
|
|
235
|
+
offsetX = 1;
|
|
236
|
+
offsetY = -4;
|
|
237
|
+
}
|
|
238
|
+
} else if (cityPiece.position == 0) {
|
|
229
239
|
offsetX = -6;
|
|
230
240
|
offsetY = -18;
|
|
231
241
|
} else if (cityPiece.position == 1) {
|
|
@@ -152,10 +152,13 @@ export default class PowerPlantMarket extends Vue {
|
|
|
152
152
|
this.futureMarketCards = [];
|
|
153
153
|
gameState.futureMarket.forEach((card, i) => {
|
|
154
154
|
if (card.number != gameState.chosenPowerPlant?.number) {
|
|
155
|
+
// Europe step 1 has 5 plants in the future market; the 5th would
|
|
156
|
+
// sit under the bid calculator at x=actualMarketWidth, so wrap
|
|
157
|
+
// to a second row.
|
|
155
158
|
this.futureMarketCards.push({
|
|
156
159
|
id: 'future_' + i,
|
|
157
|
-
x: 165 + i * 65,
|
|
158
|
-
y: 90,
|
|
160
|
+
x: 165 + (i % 4) * 65,
|
|
161
|
+
y: 90 + Math.floor(i / 4) * 50,
|
|
159
162
|
powerPlant: card
|
|
160
163
|
});
|
|
161
164
|
}
|
|
@@ -4,6 +4,42 @@
|
|
|
4
4
|
The South market re-uses the existing rendering below; Korea-specific
|
|
5
5
|
cube positions are populated in createPieces. -->
|
|
6
6
|
<template v-if="isKorea">
|
|
7
|
+
<template v-if="resourceResupplyNorth">
|
|
8
|
+
<text
|
|
9
|
+
v-if="resourceResupplyNorth[0] < 10"
|
|
10
|
+
x="30"
|
|
11
|
+
y="-125"
|
|
12
|
+
font-weight="600"
|
|
13
|
+
fill="black"
|
|
14
|
+
style="font-size: 24px"
|
|
15
|
+
>Resource Resupply:</text
|
|
16
|
+
>
|
|
17
|
+
<text v-else x="20" y="-125" font-weight="600" fill="black" style="font-size: 24px"
|
|
18
|
+
>Resource Resupply:</text
|
|
19
|
+
>
|
|
20
|
+
<text
|
|
21
|
+
v-if="resourceResupplyNorth[0] < 10"
|
|
22
|
+
x="276"
|
|
23
|
+
y="-125"
|
|
24
|
+
font-weight="600"
|
|
25
|
+
fill="black"
|
|
26
|
+
style="font-size: 24px"
|
|
27
|
+
>
|
|
28
|
+
{{ resourceResupplyNorth[0] }}
|
|
29
|
+
</text>
|
|
30
|
+
<text v-else x="262" y="-125" font-weight="600" fill="black" style="font-size: 24px">
|
|
31
|
+
{{ resourceResupplyNorth[0] }}
|
|
32
|
+
</text>
|
|
33
|
+
<Coal :pieceId="-1" :targetState="{ x: 288, y: -133 }" :canClick="false" :transparent="false" />
|
|
34
|
+
<text x="321" y="-125" font-weight="600" fill="black" style="font-size: 24px">
|
|
35
|
+
{{ resourceResupplyNorth[1] }}
|
|
36
|
+
</text>
|
|
37
|
+
<Oil :pieceId="-1" :targetState="{ x: 331, y: -134 }" :canClick="false" :transparent="false" />
|
|
38
|
+
<text x="368" y="-125" font-weight="600" fill="black" style="font-size: 24px">
|
|
39
|
+
{{ resourceResupplyNorth[2] }}
|
|
40
|
+
</text>
|
|
41
|
+
<Garbage :pieceId="-1" :targetState="{ x: 382, y: -134 }" :canClick="false" :transparent="false" />
|
|
42
|
+
</template>
|
|
7
43
|
<text x="20" y="-110" font-weight="700" fill="black" style="font-size: 22px">North Market</text>
|
|
8
44
|
<rect width="760" height="80" x="20" y="-100" rx="3" fill="#c89c3a" />
|
|
9
45
|
<template v-for="index in 8">
|
|
@@ -377,6 +413,7 @@ import { range } from 'lodash';
|
|
|
377
413
|
})
|
|
378
414
|
export default class Resources extends Vue {
|
|
379
415
|
@Prop() resourceResupply?: number[];
|
|
416
|
+
@Prop() resourceResupplyNorth?: number[];
|
|
380
417
|
@Prop() isUsaRecharged?: boolean;
|
|
381
418
|
@Prop() isMiddleEast?: boolean;
|
|
382
419
|
@Prop() isIndiaResourceMarket?: boolean;
|
package/src/self-contained.ts
CHANGED
|
@@ -10,11 +10,7 @@ function launchSelfContained(selector = '#app') {
|
|
|
10
10
|
|
|
11
11
|
const emitter = launch(selector);
|
|
12
12
|
|
|
13
|
-
let gameState = setup(
|
|
14
|
-
5,
|
|
15
|
-
{ map: 'Baden-Württemberg', variant: 'original', showMoney: true, randomizeMap: false },
|
|
16
|
-
'7'
|
|
17
|
-
);
|
|
13
|
+
let gameState = setup(5, { map: 'Japan', variant: 'recharged', showMoney: true, randomizeMap: false }, '7');
|
|
18
14
|
|
|
19
15
|
// Dev coord-picker example (commented; uncomment + drop a board photo into
|
|
20
16
|
// viewer/public/ to author city coordinates for a new map). See the picker
|