powergrid-viewer 1.5.4
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/README.md +35 -0
- package/dist/img/help.ba7779cc.svg +1 -0
- package/dist/img/log.04ef6981.svg +1 -0
- package/dist/img/pass.da9065dc.svg +3 -0
- package/dist/img/rules.64f9aae5.svg +28 -0
- package/dist/img/sound-off.72ada995.svg +3 -0
- package/dist/img/sound-on.c55edd90.svg +3 -0
- package/dist/img/undo.208666d2.svg +3 -0
- package/dist/media/notification.55fa47dd.ogg +0 -0
- package/dist/media/notification.ac905963.mp3 +0 -0
- package/dist/media/piece-drop.eef5f607.mp3 +0 -0
- package/dist/powergrid-viewer.css +1 -0
- package/dist/powergrid-viewer.umd.min.js +35 -0
- package/package.json +49 -0
- package/src/audio/notification.mp3 +0 -0
- package/src/audio/notification.ogg +0 -0
- package/src/audio/piece-drop.mp3 +0 -0
- package/src/components/Calculator.vue +62 -0
- package/src/components/Game.vue +1354 -0
- package/src/components/PlayerBoard.vue +230 -0
- package/src/components/boards/CityCount.vue +82 -0
- package/src/components/boards/Map.vue +196 -0
- package/src/components/boards/PlayerOrder.vue +68 -0
- package/src/components/boards/PowerPlantMarket.vue +184 -0
- package/src/components/boards/Resources.vue +446 -0
- package/src/components/buttons/Button.vue +26 -0
- package/src/components/buttons/HelpButton.vue +18 -0
- package/src/components/buttons/LogButton.vue +15 -0
- package/src/components/buttons/PassButton.vue +18 -0
- package/src/components/buttons/RulesButton.vue +14 -0
- package/src/components/buttons/SoundButton.vue +18 -0
- package/src/components/buttons/UndoButton.vue +17 -0
- package/src/components/buttons/index.js +9 -0
- package/src/components/pieces/Card.vue +131 -0
- package/src/components/pieces/Coal.vue +40 -0
- package/src/components/pieces/Garbage.vue +40 -0
- package/src/components/pieces/House.vue +51 -0
- package/src/components/pieces/Hybrid.vue +37 -0
- package/src/components/pieces/Oil.vue +40 -0
- package/src/components/pieces/Piece.vue +104 -0
- package/src/components/pieces/Uranium.vue +32 -0
- package/src/components/pieces/index.js +10 -0
- package/src/icons/help.svg +1 -0
- package/src/icons/log.svg +1 -0
- package/src/icons/pass.svg +3 -0
- package/src/icons/rules.svg +28 -0
- package/src/icons/sound-off.svg +3 -0
- package/src/icons/sound-on.svg +3 -0
- package/src/icons/undo.svg +3 -0
- package/src/launch.ts +87 -0
- package/src/main.ts +3 -0
- package/src/self-contained.ts +97 -0
- package/src/shims-tsx.d.ts +13 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/types/ui-data.ts +34 -0
- package/src/wrapper.ts +8 -0
- package/tsconfig.json +23 -0
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "powergrid-viewer",
|
|
3
|
+
"version": "1.5.4",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"core-js": "^3.6.5",
|
|
6
|
+
"lodash": "^4.17.19",
|
|
7
|
+
"regenerator-runtime": "^0.13.7",
|
|
8
|
+
"tslib": "^2.2.0",
|
|
9
|
+
"vue": "^2.6.11",
|
|
10
|
+
"vue-class-component": "^7.2.3",
|
|
11
|
+
"vue-property-decorator": "^8.4.2",
|
|
12
|
+
"powergrid-engine": "1.9.7"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/assert": "^1.4.7",
|
|
16
|
+
"@types/chai": "^4.2.11",
|
|
17
|
+
"@types/events": "^3.0.0",
|
|
18
|
+
"@types/lodash": "^4.14.154",
|
|
19
|
+
"@types/mocha": "^5.2.4",
|
|
20
|
+
"@typescript-eslint/parser": "^4.26.1",
|
|
21
|
+
"@vue/cli-plugin-babel": "~4.4.0",
|
|
22
|
+
"@vue/cli-plugin-typescript": "~4.4.0",
|
|
23
|
+
"@vue/cli-plugin-unit-mocha": "~4.4.0",
|
|
24
|
+
"@vue/cli-service": "~4.4.0",
|
|
25
|
+
"@vue/test-utils": "^1.0.3",
|
|
26
|
+
"chai": "^4.1.2",
|
|
27
|
+
"eslint": "^7.28.0",
|
|
28
|
+
"eslint-plugin-vue": "^7.11.0",
|
|
29
|
+
"sass": "^1.26.5",
|
|
30
|
+
"sass-loader": "^8.0.2",
|
|
31
|
+
"typescript": "^4.3.5",
|
|
32
|
+
"vue-template-compiler": "^2.6.11"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"src",
|
|
36
|
+
"dist/powergrid-viewer.umd.min.js",
|
|
37
|
+
"dist/powergrid-viewer.css",
|
|
38
|
+
"dist/img",
|
|
39
|
+
"dist/media",
|
|
40
|
+
"tsconfig.json",
|
|
41
|
+
"public/audio"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"serve": "vue-cli-service serve",
|
|
45
|
+
"build": "vue-cli-service build",
|
|
46
|
+
"test:unit": "vue-cli-service test:unit",
|
|
47
|
+
"package": "vue-cli-service build --target lib --name powergrid-viewer src/wrapper.ts"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<g class="calculator">
|
|
3
|
+
<rect width="125" height="50" rx="4" />
|
|
4
|
+
<rect x="10" y="10" width="30" height="30" fill="lime" rx="2" />
|
|
5
|
+
<text class="visor" x="25" y="25" fill="black" text-anchor="middle">{{ value }}</text>
|
|
6
|
+
<g :style="value < maxValue ? 'cursor: pointer' : ''" @click="add()">
|
|
7
|
+
<rect x="48" y="7" width="24" height="15" fill="gray" stroke="gray" rx="2" />
|
|
8
|
+
<path d="M52,17 l8,-6 l8,6" fill="none" stroke="white" stroke-width="3" />
|
|
9
|
+
</g>
|
|
10
|
+
<g :style="value > minValue ? 'cursor: pointer' : ''" @click="sub()">
|
|
11
|
+
<rect x="48" y="28" width="24" height="15" fill="gray" stroke="gray" rx="2" />
|
|
12
|
+
<path d="M52,32 l8,6 l8,-6" fill="none" stroke="white" stroke-width="3" />
|
|
13
|
+
</g>
|
|
14
|
+
<g style="cursor: pointer" @click="bid()">
|
|
15
|
+
<rect class="button" x="80" y="7" width="36" height="36" fill="gray" rx="2" />
|
|
16
|
+
<text x="97" y="25" fill="white" text-anchor="middle">OK</text>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
import { Vue, Component, Prop } from 'vue-property-decorator';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
created(this: Calculator) {
|
|
25
|
+
this.value = this.minValue;
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
export default class Calculator extends Vue {
|
|
29
|
+
@Prop()
|
|
30
|
+
minValue;
|
|
31
|
+
|
|
32
|
+
@Prop()
|
|
33
|
+
maxValue;
|
|
34
|
+
|
|
35
|
+
value: number = 0;
|
|
36
|
+
|
|
37
|
+
add() {
|
|
38
|
+
this.value = Math.min(this.maxValue, this.value + 1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
sub() {
|
|
42
|
+
this.value = Math.max(this.minValue, this.value - 1);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
bid() {
|
|
46
|
+
this.$emit('bid', this.value);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
<style lang="scss">
|
|
51
|
+
.calculator {
|
|
52
|
+
fill: #333;
|
|
53
|
+
|
|
54
|
+
.button {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.visor {
|
|
59
|
+
font-family: 'system-ui';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</style>
|