This commit is contained in:
Lucas Mello 2021-06-13 11:26:45 -03:00
commit 815481fcff
24 changed files with 870 additions and 13198 deletions

26
.eslintrc.js Normal file
View file

@ -0,0 +1,26 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/recommended'
],
rules: {
'vue/no-unused-vars': 'error',
'vue/html-indent': ['error', 4, { 'alignAttributesVertically': false }],
'vue/max-attributes-per-line': 0,
'vue/html-closing-bracket-newline': ['error', {
'singleline': 'never',
'multiline': 'never'
}],
'vue/attribute-hyphenation': ['error', 'never'],
'vue/singleline-html-element-content-newline': 'off',
'no-case-declarations': 'off',
'no-unused-vars': 'off',
'quotes': ['error', 'single']
},
env: {
node: true
},
parserOptions: {
parser: '@typescript-eslint/parser'
}
}

15
.vscode/settings.json vendored
View file

@ -1,7 +1,20 @@
{
"editor.tabSize": 4,
"editor.acceptSuggestionOnCommitCharacter": false,
"editor.formatOnSave": true,
"editor.suggestSelection": "first",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"vetur.format.options.tabSize": 4,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"prettier.tabWidth": 4,
"files.trimTrailingWhitespace": true,
"vetur.format.defaultFormatter.html": "none"
"vetur.format.defaultFormatter.html": "none",
"eslint.validate": [
"javascript",
"typescript",
"vue"
]
}

12495
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "container-viewer",
"version": "0.0.1",
"version": "1.0.9",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
@ -12,6 +12,7 @@
"container-engine": "workspace:../container-engine",
"core-js": "^3.6.5",
"lodash": "^4.17.19",
"regenerator-runtime": "^0.13.7",
"tslib": "^2.2.0",
"vue": "^2.6.11",
"vue-class-component": "^7.2.3",
@ -23,21 +24,25 @@
"@types/events": "^3.0.0",
"@types/lodash": "^4.14.154",
"@types/mocha": "^5.2.4",
"@typescript-eslint/parser": "^4.26.1",
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-typescript": "~4.4.0",
"@vue/cli-plugin-unit-mocha": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"@vue/test-utils": "^1.0.3",
"chai": "^4.1.2",
"eslint": "^7.28.0",
"eslint-plugin-vue": "^7.11.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"typescript": "~3.9.3",
"typescript": "~3.9.9",
"vue-template-compiler": "^2.6.11"
},
"files": [
"src",
"dist/container-viewer.umd.min.js",
"dist/container-viewer.css",
"dist/img",
"tsconfig.json"
]
}
}

519
pnpm-lock.yaml generated
View file

@ -6,6 +6,7 @@ specifiers:
'@types/events': ^3.0.0
'@types/lodash': ^4.14.154
'@types/mocha': ^5.2.4
'@typescript-eslint/parser': ^4.26.1
'@vue/cli-plugin-babel': ~4.4.0
'@vue/cli-plugin-typescript': ~4.4.0
'@vue/cli-plugin-unit-mocha': ~4.4.0
@ -14,11 +15,14 @@ specifiers:
chai: ^4.1.2
container-engine: workspace:../container-engine
core-js: ^3.6.5
eslint: ^7.28.0
eslint-plugin-vue: ^7.11.0
lodash: ^4.17.19
regenerator-runtime: ^0.13.7
sass: ^1.26.5
sass-loader: ^8.0.2
tslib: ^2.2.0
typescript: ~3.9.3
typescript: ~3.9.9
vue: ^2.6.11
vue-class-component: ^7.2.3
vue-property-decorator: ^8.4.2
@ -28,6 +32,7 @@ dependencies:
container-engine: link:../container-engine
core-js: 3.12.1
lodash: 4.17.21
regenerator-runtime: 0.13.7
tslib: 2.2.0
vue: 2.6.12
vue-class-component: 7.2.6_vue@2.6.12
@ -39,12 +44,15 @@ devDependencies:
'@types/events': 3.0.0
'@types/lodash': 4.14.169
'@types/mocha': 5.2.7
'@typescript-eslint/parser': 4.26.1_eslint@7.28.0+typescript@3.9.9
'@vue/cli-plugin-babel': 4.4.6_a17f8753fefa6d1bd7cb7a980cc59ef3
'@vue/cli-plugin-typescript': 4.4.6_33f9cb31a4a8b0794e2aeda7d022d7f8
'@vue/cli-plugin-unit-mocha': 4.4.6_@vue+cli-service@4.4.6
'@vue/cli-service': 4.4.6_b39d0f596a40085f040304bdc020688d
'@vue/test-utils': 1.2.0_ae554d8947d7e926b014dda25865f517
chai: 4.3.4
eslint: 7.28.0
eslint-plugin-vue: 7.11.0_eslint@7.28.0
sass: 1.32.13
sass-loader: 8.0.2_sass@1.32.13
typescript: 3.9.9
@ -52,6 +60,12 @@ devDependencies:
packages:
/@babel/code-frame/7.12.11:
resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==}
dependencies:
'@babel/highlight': 7.14.5
dev: true
/@babel/code-frame/7.12.13:
resolution: {integrity: sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==}
dependencies:
@ -271,6 +285,11 @@ packages:
resolution: {integrity: sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==}
dev: true
/@babel/helper-validator-identifier/7.14.5:
resolution: {integrity: sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==}
engines: {node: '>=6.9.0'}
dev: true
/@babel/helper-validator-option/7.12.17:
resolution: {integrity: sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==}
dev: true
@ -304,6 +323,15 @@ packages:
js-tokens: 4.0.0
dev: true
/@babel/highlight/7.14.5:
resolution: {integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/helper-validator-identifier': 7.14.5
chalk: 2.4.2
js-tokens: 4.0.0
dev: true
/@babel/parser/7.14.2:
resolution: {integrity: sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==}
engines: {node: '>=6.0.0'}
@ -1125,6 +1153,23 @@ packages:
to-fast-properties: 2.0.0
dev: true
/@eslint/eslintrc/0.4.2:
resolution: {integrity: sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==}
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
ajv: 6.12.6
debug: 4.3.1
espree: 7.3.1
globals: 13.9.0
ignore: 4.0.6
import-fresh: 3.3.0
js-yaml: 3.14.1
minimatch: 3.0.4
strip-json-comments: 3.1.1
transitivePeerDependencies:
- supports-color
dev: true
/@hapi/address/2.1.4:
resolution: {integrity: sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ==}
deprecated: Moved to 'npm install @sideway/address'
@ -1176,11 +1221,11 @@ packages:
glob-to-regexp: 0.3.0
dev: true
/@nodelib/fs.scandir/2.1.4:
resolution: {integrity: sha512-33g3pMJk3bg5nXbL/+CY6I2eJDzZAni49PfJnL5fghPTggPvBd/pFNSgJsdAgWptuFu7qq/ERvOYFlhvsLTCKA==}
/@nodelib/fs.scandir/2.1.5:
resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.stat': 2.0.4
'@nodelib/fs.stat': 2.0.5
run-parallel: 1.2.0
dev: true
@ -1189,16 +1234,16 @@ packages:
engines: {node: '>= 6'}
dev: true
/@nodelib/fs.stat/2.0.4:
resolution: {integrity: sha512-IYlHJA0clt2+Vg7bccq+TzRdJvv19c2INqBSsoOLp1je7xjtr7J26+WXR72MCdvU9q1qTzIWDfhMf+DRvQJK4Q==}
/@nodelib/fs.stat/2.0.5:
resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==}
engines: {node: '>= 8'}
dev: true
/@nodelib/fs.walk/1.2.6:
resolution: {integrity: sha512-8Broas6vTtW4GIXTAHDoE32hnN2M5ykgCpWGbuXHQ15vEMqr23pB76e/GZcYsZCHALv50ktd24qhEyKr6wBtow==}
/@nodelib/fs.walk/1.2.7:
resolution: {integrity: sha512-BTIhocbPBSrRmHxOAJFtR18oLhxTtAFDAvL8hY1S3iU8k+E60W/YFs4jrixGzQjMpF4qPXxIQHcjVD9dz1C2QA==}
engines: {node: '>= 8'}
dependencies:
'@nodelib/fs.scandir': 2.1.4
'@nodelib/fs.scandir': 2.1.5
fastq: 1.11.0
dev: true
@ -1270,6 +1315,68 @@ packages:
resolution: {integrity: sha512-Fx+NpfOO0CpeYX2g9bkvX8O5qh9wrU1sOF4g8sft4Mu7z+qfe387YlyY8w8daDyDsKY5vUxM0yxkAYnbkRbZEw==}
dev: true
/@typescript-eslint/parser/4.26.1_eslint@7.28.0+typescript@3.9.9:
resolution: {integrity: sha512-q7F3zSo/nU6YJpPJvQveVlIIzx9/wu75lr6oDbDzoeIRWxpoc/HQ43G4rmMoCc5my/3uSj2VEpg/D83LYZF5HQ==}
engines: {node: ^10.12.0 || >=12.0.0}
peerDependencies:
eslint: ^5.0.0 || ^6.0.0 || ^7.0.0
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/scope-manager': 4.26.1
'@typescript-eslint/types': 4.26.1
'@typescript-eslint/typescript-estree': 4.26.1_typescript@3.9.9
debug: 4.3.1
eslint: 7.28.0
typescript: 3.9.9
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/scope-manager/4.26.1:
resolution: {integrity: sha512-TW1X2p62FQ8Rlne+WEShyd7ac2LA6o27S9i131W4NwDSfyeVlQWhw8ylldNNS8JG6oJB9Ha9Xyc+IUcqipvheQ==}
engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
dependencies:
'@typescript-eslint/types': 4.26.1
'@typescript-eslint/visitor-keys': 4.26.1
dev: true
/@typescript-eslint/types/4.26.1:
resolution: {integrity: sha512-STyMPxR3cS+LaNvS8yK15rb8Y0iL0tFXq0uyl6gY45glyI7w0CsyqyEXl/Fa0JlQy+pVANeK3sbwPneCbWE7yg==}
engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
dev: true
/@typescript-eslint/typescript-estree/4.26.1_typescript@3.9.9:
resolution: {integrity: sha512-l3ZXob+h0NQzz80lBGaykdScYaiEbFqznEs99uwzm8fPHhDjwaBFfQkjUC/slw6Sm7npFL8qrGEAMxcfBsBJUg==}
engines: {node: ^10.12.0 || >=12.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 4.26.1
'@typescript-eslint/visitor-keys': 4.26.1
debug: 4.3.1
globby: 11.0.3
is-glob: 4.0.1
semver: 7.3.5
tsutils: 3.21.0_typescript@3.9.9
typescript: 3.9.9
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/visitor-keys/4.26.1:
resolution: {integrity: sha512-IGouNSSd+6x/fHtYRyLOM6/C+QxMDzWlDtN41ea+flWuSF9g02iqcIlX8wM53JkfljoIjP0U+yp7SiTS1onEkw==}
engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1}
dependencies:
'@typescript-eslint/types': 4.26.1
eslint-visitor-keys: 2.1.0
dev: true
/@vue/babel-helper-vue-jsx-merge-props/1.2.1:
resolution: {integrity: sha512-QOi5OW45e2R20VygMSNhyQHvpdUwQZqGPc748JLGCYEy+yp8fNFNdbNIGAgZmi9e+2JHPd6i6idRuqivyicIkA==}
dev: true
@ -1803,6 +1910,14 @@ packages:
acorn-walk: 6.2.0
dev: true
/acorn-jsx/5.3.1_acorn@7.4.1:
resolution: {integrity: sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==}
peerDependencies:
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
dependencies:
acorn: 7.4.1
dev: true
/acorn-walk/6.2.0:
resolution: {integrity: sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==}
engines: {node: '>=0.4.0'}
@ -1863,6 +1978,15 @@ packages:
uri-js: 4.4.1
dev: true
/ajv/8.6.0:
resolution: {integrity: sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==}
dependencies:
fast-deep-equal: 3.1.3
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
uri-js: 4.4.1
dev: true
/alphanum-sort/1.0.2:
resolution: {integrity: sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=}
dev: true
@ -1877,6 +2001,11 @@ packages:
engines: {node: '>=6'}
dev: true
/ansi-colors/4.1.1:
resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==}
engines: {node: '>=6'}
dev: true
/ansi-html/0.0.7:
resolution: {integrity: sha1-gTWEAhliqenm/QOflA0S9WynhZ4=}
engines: {'0': node >= 0.8.0}
@ -2040,6 +2169,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/astral-regex/2.0.0:
resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
engines: {node: '>=8'}
dev: true
/async-each/1.0.3:
resolution: {integrity: sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==}
dev: true
@ -2515,6 +2649,11 @@ packages:
engines: {node: '>=4'}
dev: true
/callsites/3.1.0:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'}
dev: true
/camel-case/3.0.0:
resolution: {integrity: sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=}
dependencies:
@ -3475,6 +3614,13 @@ packages:
buffer-indexof: 1.1.1
dev: true
/doctrine/3.0.0:
resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
engines: {node: '>=6.0.0'}
dependencies:
esutils: 2.0.3
dev: true
/dom-converter/0.2.0:
resolution: {integrity: sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==}
dependencies:
@ -3639,6 +3785,13 @@ packages:
tapable: 1.1.3
dev: true
/enquirer/2.3.6:
resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}
engines: {node: '>=8.6'}
dependencies:
ansi-colors: 4.1.1
dev: true
/entities/1.1.2:
resolution: {integrity: sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==}
dev: true
@ -3711,6 +3864,11 @@ packages:
engines: {node: '>=0.8.0'}
dev: true
/escape-string-regexp/4.0.0:
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
engines: {node: '>=10'}
dev: true
/escodegen/1.14.3:
resolution: {integrity: sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==}
engines: {node: '>=4.0'}
@ -3724,6 +3882,21 @@ packages:
source-map: 0.6.1
dev: true
/eslint-plugin-vue/7.11.0_eslint@7.28.0:
resolution: {integrity: sha512-Qwo8wilqnOXnG9B5auEiTstyaHefyhHd5lEhhxemwXoWsAxIW2yppzuVudowC5n+qn1nMLNV9TANkTthBK7Waw==}
engines: {node: '>=8.10'}
peerDependencies:
eslint: ^6.2.0 || ^7.0.0
dependencies:
eslint: 7.28.0
eslint-utils: 2.1.0
natural-compare: 1.4.0
semver: 7.3.5
vue-eslint-parser: 7.6.0_eslint@7.28.0
transitivePeerDependencies:
- supports-color
dev: true
/eslint-scope/4.0.3:
resolution: {integrity: sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==}
engines: {node: '>=4.0.0'}
@ -3732,12 +3905,110 @@ packages:
estraverse: 4.3.0
dev: true
/eslint-scope/5.1.1:
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
engines: {node: '>=8.0.0'}
dependencies:
esrecurse: 4.3.0
estraverse: 4.3.0
dev: true
/eslint-utils/2.1.0:
resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==}
engines: {node: '>=6'}
dependencies:
eslint-visitor-keys: 1.3.0
dev: true
/eslint-visitor-keys/1.3.0:
resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==}
engines: {node: '>=4'}
dev: true
/eslint-visitor-keys/2.1.0:
resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==}
engines: {node: '>=10'}
dev: true
/eslint/7.28.0:
resolution: {integrity: sha512-UMfH0VSjP0G4p3EWirscJEQ/cHqnT/iuH6oNZOB94nBjWbMnhGEPxsZm1eyIW0C/9jLI0Fow4W5DXLjEI7mn1g==}
engines: {node: ^10.12.0 || >=12.0.0}
hasBin: true
dependencies:
'@babel/code-frame': 7.12.11
'@eslint/eslintrc': 0.4.2
ajv: 6.12.6
chalk: 4.1.1
cross-spawn: 7.0.3
debug: 4.3.1
doctrine: 3.0.0
enquirer: 2.3.6
escape-string-regexp: 4.0.0
eslint-scope: 5.1.1
eslint-utils: 2.1.0
eslint-visitor-keys: 2.1.0
espree: 7.3.1
esquery: 1.4.0
esutils: 2.0.3
fast-deep-equal: 3.1.3
file-entry-cache: 6.0.1
functional-red-black-tree: 1.0.1
glob-parent: 5.1.2
globals: 13.9.0
ignore: 4.0.6
import-fresh: 3.3.0
imurmurhash: 0.1.4
is-glob: 4.0.1
js-yaml: 3.14.1
json-stable-stringify-without-jsonify: 1.0.1
levn: 0.4.1
lodash.merge: 4.6.2
minimatch: 3.0.4
natural-compare: 1.4.0
optionator: 0.9.1
progress: 2.0.3
regexpp: 3.1.0
semver: 7.3.5
strip-ansi: 6.0.0
strip-json-comments: 3.1.1
table: 6.7.1
text-table: 0.2.0
v8-compile-cache: 2.3.0
transitivePeerDependencies:
- supports-color
dev: true
/espree/6.2.1:
resolution: {integrity: sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==}
engines: {node: '>=6.0.0'}
dependencies:
acorn: 7.4.1
acorn-jsx: 5.3.1_acorn@7.4.1
eslint-visitor-keys: 1.3.0
dev: true
/espree/7.3.1:
resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==}
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
acorn: 7.4.1
acorn-jsx: 5.3.1_acorn@7.4.1
eslint-visitor-keys: 1.3.0
dev: true
/esprima/4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
hasBin: true
dev: true
/esquery/1.4.0:
resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}
engines: {node: '>=0.10'}
dependencies:
estraverse: 5.2.0
dev: true
/esrecurse/4.3.0:
resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==}
engines: {node: '>=4.0'}
@ -3942,12 +4213,12 @@ packages:
resolution: {integrity: sha512-2DtFcgT68wiTTiwZ2hNdJfcHNke9XOfnwmBRWXhmeKM8rF0TGwmC/Qto3S7RoZKp5cilZbxzO5iTNTQsJ+EeDg==}
engines: {node: '>=8'}
dependencies:
'@nodelib/fs.stat': 2.0.4
'@nodelib/fs.walk': 1.2.6
glob-parent: 5.1.0
'@nodelib/fs.stat': 2.0.5
'@nodelib/fs.walk': 1.2.7
glob-parent: 5.1.2
merge2: 1.4.1
micromatch: 4.0.4
picomatch: 2.2.3
picomatch: 2.3.0
dev: true
/fast-json-stable-stringify/2.1.0:
@ -3975,6 +4246,13 @@ packages:
resolution: {integrity: sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==}
dev: true
/file-entry-cache/6.0.1:
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
flat-cache: 3.0.4
dev: true
/file-loader/4.3.0_webpack@4.46.0:
resolution: {integrity: sha512-aKrYPYjF1yG3oX0kWRrqrSMfgftm7oJW5M+m4owoldH5C51C0RkIwB++JbRvEW3IU6/ZG5n8UvEcdgwOt2UOWA==}
engines: {node: '>= 8.9.0'}
@ -4059,6 +4337,14 @@ packages:
path-exists: 4.0.0
dev: true
/flat-cache/3.0.4:
resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
engines: {node: ^10.12.0 || >=12.0.0}
dependencies:
flatted: 3.1.1
rimraf: 3.0.2
dev: true
/flat/4.1.1:
resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==}
hasBin: true
@ -4066,6 +4352,10 @@ packages:
is-buffer: 2.0.5
dev: true
/flatted/3.1.1:
resolution: {integrity: sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==}
dev: true
/flush-write-stream/1.1.1:
resolution: {integrity: sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==}
dependencies:
@ -4193,6 +4483,10 @@ packages:
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
dev: true
/functional-red-black-tree/1.0.1:
resolution: {integrity: sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=}
dev: true
/gensync/1.0.0-beta.2:
resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==}
engines: {node: '>=6.9.0'}
@ -4297,6 +4591,13 @@ packages:
engines: {node: '>=4'}
dev: true
/globals/13.9.0:
resolution: {integrity: sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==}
engines: {node: '>=8'}
dependencies:
type-fest: 0.20.2
dev: true
/globby/10.0.2:
resolution: {integrity: sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==}
engines: {node: '>=8'}
@ -4311,6 +4612,18 @@ packages:
slash: 3.0.0
dev: true
/globby/11.0.3:
resolution: {integrity: sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==}
engines: {node: '>=10'}
dependencies:
array-union: 2.1.0
dir-glob: 3.0.1
fast-glob: 3.2.5
ignore: 5.1.8
merge2: 1.4.1
slash: 3.0.0
dev: true
/globby/6.1.0:
resolution: {integrity: sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=}
engines: {node: '>=0.10.0'}
@ -4712,6 +5025,14 @@ packages:
resolve-from: 3.0.0
dev: true
/import-fresh/3.3.0:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
dependencies:
parent-module: 1.0.1
resolve-from: 4.0.0
dev: true
/import-from/2.1.0:
resolution: {integrity: sha1-M1238qev/VOqpHHUuAId7ja387E=}
engines: {node: '>=4'}
@ -5264,10 +5585,18 @@ packages:
resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==}
dev: true
/json-schema-traverse/1.0.0:
resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==}
dev: true
/json-schema/0.2.3:
resolution: {integrity: sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=}
dev: true
/json-stable-stringify-without-jsonify/1.0.1:
resolution: {integrity: sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=}
dev: true
/json-stringify-safe/5.0.1:
resolution: {integrity: sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=}
dev: true
@ -5361,6 +5690,14 @@ packages:
type-check: 0.3.2
dev: true
/levn/0.4.1:
resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==}
engines: {node: '>= 0.8.0'}
dependencies:
prelude-ls: 1.2.1
type-check: 0.4.0
dev: true
/lines-and-columns/1.1.6:
resolution: {integrity: sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=}
dev: true
@ -5403,6 +5740,10 @@ packages:
p-locate: 4.1.0
dev: true
/lodash.clonedeep/4.5.0:
resolution: {integrity: sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=}
dev: true
/lodash.debounce/4.0.8:
resolution: {integrity: sha1-gteb/zCmfEAF/9XiUVMArZyk168=}
dev: true
@ -5423,6 +5764,10 @@ packages:
resolution: {integrity: sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=}
dev: true
/lodash.merge/4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
dev: true
/lodash.sortby/4.7.0:
resolution: {integrity: sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=}
dev: true
@ -5431,6 +5776,10 @@ packages:
resolution: {integrity: sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=}
dev: true
/lodash.truncate/4.4.2:
resolution: {integrity: sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=}
dev: true
/lodash.uniq/4.5.0:
resolution: {integrity: sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=}
dev: true
@ -5467,6 +5816,13 @@ packages:
yallist: 3.1.1
dev: true
/lru-cache/6.0.0:
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
engines: {node: '>=10'}
dependencies:
yallist: 4.0.0
dev: true
/make-dir/2.1.0:
resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==}
engines: {node: '>=6'}
@ -5857,6 +6213,10 @@ packages:
to-regex: 3.0.2
dev: true
/natural-compare/1.4.0:
resolution: {integrity: sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=}
dev: true
/negotiator/0.6.2:
resolution: {integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==}
engines: {node: '>= 0.6'}
@ -6171,6 +6531,18 @@ packages:
word-wrap: 1.2.3
dev: true
/optionator/0.9.1:
resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==}
engines: {node: '>= 0.8.0'}
dependencies:
deep-is: 0.1.3
fast-levenshtein: 2.0.6
levn: 0.4.1
prelude-ls: 1.2.1
type-check: 0.4.0
word-wrap: 1.2.3
dev: true
/ora/3.4.0:
resolution: {integrity: sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==}
engines: {node: '>=6'}
@ -6266,6 +6638,13 @@ packages:
no-case: 2.3.2
dev: true
/parent-module/1.0.1:
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
engines: {node: '>=6'}
dependencies:
callsites: 3.1.0
dev: true
/parse-asn1/5.1.6:
resolution: {integrity: sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==}
dependencies:
@ -6403,6 +6782,11 @@ packages:
engines: {node: '>=8.6'}
dev: true
/picomatch/2.3.0:
resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==}
engines: {node: '>=8.6'}
dev: true
/pify/2.3.0:
resolution: {integrity: sha1-7RQaasBDqEnqWISY59yosVMw6Qw=}
engines: {node: '>=0.10.0'}
@ -6805,6 +7189,11 @@ packages:
engines: {node: '>= 0.8.0'}
dev: true
/prelude-ls/1.2.1:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
dev: true
/prepend-http/1.0.4:
resolution: {integrity: sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=}
engines: {node: '>=0.10.0'}
@ -7050,7 +7439,6 @@ packages:
/regenerator-runtime/0.13.7:
resolution: {integrity: sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==}
dev: true
/regenerator-transform/0.14.5:
resolution: {integrity: sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==}
@ -7074,6 +7462,11 @@ packages:
define-properties: 1.1.3
dev: true
/regexpp/3.1.0:
resolution: {integrity: sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==}
engines: {node: '>=8'}
dev: true
/regexpu-core/4.7.1:
resolution: {integrity: sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==}
engines: {node: '>=4'}
@ -7181,6 +7574,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/require-from-string/2.0.2:
resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==}
engines: {node: '>=0.10.0'}
dev: true
/require-main-filename/2.0.0:
resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==}
dev: true
@ -7201,6 +7599,11 @@ packages:
engines: {node: '>=4'}
dev: true
/resolve-from/4.0.0:
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
dev: true
/resolve-url/0.2.1:
resolution: {integrity: sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=}
deprecated: https://github.com/lydell/resolve-url#deprecated
@ -7251,6 +7654,13 @@ packages:
glob: 7.1.7
dev: true
/rimraf/3.0.2:
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
hasBin: true
dependencies:
glob: 7.1.7
dev: true
/ripemd160/2.0.2:
resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==}
dependencies:
@ -7374,6 +7784,14 @@ packages:
hasBin: true
dev: true
/semver/7.3.5:
resolution: {integrity: sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==}
engines: {node: '>=10'}
hasBin: true
dependencies:
lru-cache: 6.0.0
dev: true
/send/0.17.1:
resolution: {integrity: sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==}
engines: {node: '>= 0.8.0'}
@ -7520,6 +7938,15 @@ packages:
engines: {node: '>=8'}
dev: true
/slice-ansi/4.0.0:
resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}
engines: {node: '>=10'}
dependencies:
ansi-styles: 4.3.0
astral-regex: 2.0.0
is-fullwidth-code-point: 3.0.0
dev: true
/snapdragon-node/2.1.1:
resolution: {integrity: sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==}
engines: {node: '>=0.10.0'}
@ -7859,6 +8286,11 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
/strip-json-comments/3.1.1:
resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==}
engines: {node: '>=8'}
dev: true
/stylehacks/4.0.3:
resolution: {integrity: sha512-7GlLk9JwlElY4Y6a/rmbH2MhVlTyVmiJd1PfTCqFaIBEGMYNsrO/v3SeGTdhBThLg4Z+NbOk/qFMwCa+J+3p/g==}
engines: {node: '>=6.9.0'}
@ -7929,6 +8361,18 @@ packages:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
dev: true
/table/6.7.1:
resolution: {integrity: sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==}
engines: {node: '>=10.0.0'}
dependencies:
ajv: 8.6.0
lodash.clonedeep: 4.5.0
lodash.truncate: 4.4.2
slice-ansi: 4.0.0
string-width: 4.2.2
strip-ansi: 6.0.0
dev: true
/tapable/1.1.3:
resolution: {integrity: sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==}
engines: {node: '>=6'}
@ -7980,6 +8424,10 @@ packages:
source-map-support: 0.5.19
dev: true
/text-table/0.2.0:
resolution: {integrity: sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=}
dev: true
/thenify-all/1.6.0:
resolution: {integrity: sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=}
engines: {node: '>=0.8'}
@ -8174,6 +8622,16 @@ packages:
typescript: 3.9.9
dev: true
/tsutils/3.21.0_typescript@3.9.9:
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
engines: {node: '>= 6'}
peerDependencies:
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
dependencies:
tslib: 1.14.1
typescript: 3.9.9
dev: true
/tty-browserify/0.0.0:
resolution: {integrity: sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=}
dev: true
@ -8195,11 +8653,23 @@ packages:
prelude-ls: 1.1.2
dev: true
/type-check/0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'}
dependencies:
prelude-ls: 1.2.1
dev: true
/type-detect/4.0.8:
resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
engines: {node: '>=4'}
dev: true
/type-fest/0.20.2:
resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
engines: {node: '>=10'}
dev: true
/type-fest/0.6.0:
resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==}
engines: {node: '>=8'}
@ -8418,6 +8888,10 @@ packages:
hasBin: true
dev: true
/v8-compile-cache/2.3.0:
resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
dev: true
/validate-npm-package-license/3.0.4:
resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==}
dependencies:
@ -8455,6 +8929,23 @@ packages:
vue: 2.6.12
dev: false
/vue-eslint-parser/7.6.0_eslint@7.28.0:
resolution: {integrity: sha512-QXxqH8ZevBrtiZMZK0LpwaMfevQi9UL7lY6Kcp+ogWHC88AuwUPwwCIzkOUc1LR4XsYAt/F9yHXAB/QoD17QXA==}
engines: {node: '>=8.10'}
peerDependencies:
eslint: '>=5.0.0'
dependencies:
debug: 4.3.1
eslint: 7.28.0
eslint-scope: 5.1.1
eslint-visitor-keys: 1.3.0
espree: 6.2.1
esquery: 1.4.0
lodash: 4.17.21
transitivePeerDependencies:
- supports-color
dev: true
/vue-hot-reload-api/2.3.4:
resolution: {integrity: sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==}
dev: true

View file

@ -1,11 +1,11 @@
<template>
<g class="button" @click="$emit('click')">
<rect :width="width" height="30" fill="gainsboro" stroke="black" rx="2"></rect>
<rect :width="width" height="30" fill="gainsboro" stroke="black" rx="2" />
<text text-anchor="middle" fill="black" :x="width / 2" y="16">{{ text }}</text>
</g>
</template>
<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import { Vue, Component, Prop } from 'vue-property-decorator';
@Component
export default class Button extends Vue {

View file

@ -1,12 +1,12 @@
<template>
<g class="button" @click="$emit('click')">
<rect width="70" height="30" fill="gainsboro" stroke="black" rx="2"></rect>
<path transform="translate(10,10)" d="M0 0 L5 5 L0 10 Z M5 0 L10 5 L5 10 Z" fill="black" />
<rect width="70" height="30" fill="gainsboro" stroke="black" rx="2" />
<image x="10" y="10" width="10" height="10" href="../../icons/pass.svg" />
<text text-anchor="middle" fill="black" x="42" y="16">Pass</text>
</g>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { Vue, Component } from 'vue-property-decorator';
@Component
export default class PassButton extends Vue {

View file

@ -1,12 +1,12 @@
<template>
<g class="button" @click="$emit('click')">
<rect width="70" height="30" fill="gainsboro" stroke="black" rx="2"></rect>
<path transform="translate(8,8) scale(0.025,0.025)" fill="black" d="M248.625,89.25 V0 l-127.5,127.5 l127.5,127.5 V140.25 c84.15,0,153,68.85,153,153 c0,84.15-68.85,153-153,153 c-84.15,0-153-68.85-153-153 h-51 c0,112.2,91.8,204,204,204 s204-91.8,204-204 S360.825,89.25,248.625,89.25z"/>
<rect width="70" height="30" fill="gainsboro" stroke="black" rx="2" />
<image x="6" y="6" width="16" height="16" href="../../icons/undo.svg" />
<text text-anchor="middle" fill="black" x="42" y="16">Undo</text>
</g>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { Vue, Component } from 'vue-property-decorator';
@Component
export default class UndoButton extends Vue {

View file

@ -1,36 +1,36 @@
<template>
<g class="calculator">
<rect width="130" height="210" rx="2"></rect>
<rect x="10" y="10" width="110" height="30" fill="yellowgreen" rx="2"></rect>
<rect width="130" height="210" rx="2" />
<rect x="10" y="10" width="110" height="30" fill="yellowgreen" rx="2" />
<text class="visor" x="110" y="25" fill="black" text-anchor="end">{{ value }}</text>
<rect class="button" x="10" y="50" width="30" height="30" fill="gray" rx="2" @click="add(7)"></rect>
<rect class="button" x="10" y="50" width="30" height="30" fill="gray" rx="2" @click="add(7)" />
<text x="25" y="65" fill="white" stroke="white" text-anchor="middle">7</text>
<rect class="button" x="50" y="50" width="30" height="30" fill="gray" rx="2" @click="add(8)"></rect>
<rect class="button" x="50" y="50" width="30" height="30" fill="gray" rx="2" @click="add(8)" />
<text x="65" y="65" fill="white" stroke="white" text-anchor="middle">8</text>
<rect class="button" x="90" y="50" width="30" height="30" fill="gray" rx="2" @click="add(9)"></rect>
<rect class="button" x="90" y="50" width="30" height="30" fill="gray" rx="2" @click="add(9)" />
<text x="105" y="65" fill="white" stroke="white" text-anchor="middle">9</text>
<rect class="button" x="10" y="90" width="30" height="30" fill="gray" rx="2" @click="add(4)"></rect>
<rect class="button" x="10" y="90" width="30" height="30" fill="gray" rx="2" @click="add(4)" />
<text x="25" y="105" fill="white" stroke="white" text-anchor="middle">4</text>
<rect class="button" x="50" y="90" width="30" height="30" fill="gray" rx="2" @click="add(5)"></rect>
<rect class="button" x="50" y="90" width="30" height="30" fill="gray" rx="2" @click="add(5)" />
<text x="65" y="105" fill="white" stroke="white" text-anchor="middle">5</text>
<rect class="button" x="90" y="90" width="30" height="30" fill="gray" rx="2" @click="add(6)"></rect>
<rect class="button" x="90" y="90" width="30" height="30" fill="gray" rx="2" @click="add(6)" />
<text x="105" y="105" fill="white" stroke="white" text-anchor="middle">6</text>
<rect class="button" x="10" y="130" width="30" height="30" fill="gray" rx="2" @click="add(1)"></rect>
<rect class="button" x="10" y="130" width="30" height="30" fill="gray" rx="2" @click="add(1)" />
<text x="25" y="145" fill="white" stroke="white" text-anchor="middle">1</text>
<rect class="button" x="50" y="130" width="30" height="30" fill="gray" rx="2" @click="add(2)"></rect>
<rect class="button" x="50" y="130" width="30" height="30" fill="gray" rx="2" @click="add(2)" />
<text x="65" y="145" fill="white" stroke="white" text-anchor="middle">2</text>
<rect class="button" x="90" y="130" width="30" height="30" fill="gray" rx="2" @click="add(3)"></rect>
<rect class="button" x="90" y="130" width="30" height="30" fill="gray" rx="2" @click="add(3)" />
<text x="105" y="145" fill="white" stroke="white" text-anchor="middle">3</text>
<rect class="button" x="10" y="170" width="30" height="30" fill="gray" rx="2" @click="add(0)"></rect>
<rect class="button" x="10" y="170" width="30" height="30" fill="gray" rx="2" @click="add(0)" />
<text x="25" y="185" fill="white" stroke="white" text-anchor="middle">0</text>
<rect class="button" x="50" y="170" width="30" height="30" fill="orange" rx="2" @click="del()"></rect>
<rect class="button" x="50" y="170" width="30" height="30" fill="orange" rx="2" @click="del()" />
<text x="65" y="185" fill="white" text-anchor="middle">Del</text>
<rect class="button" x="90" y="170" width="30" height="30" fill="orange" rx="2" @click="bid()"></rect>
<rect class="button" x="90" y="170" width="30" height="30" fill="orange" rx="2" @click="bid()" />
<text x="105" y="185" fill="white" text-anchor="middle">Bid</text>
</g>
</template>
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { Vue, Component } from 'vue-property-decorator';
@Component
export default class Calculator extends Vue {
@ -45,7 +45,7 @@ export default class Calculator extends Vue {
}
bid() {
this.$emit("bid", this.value);
this.$emit('bid', this.value);
this.value = 0;
}
}
@ -63,5 +63,4 @@ export default class Calculator extends Vue {
font-family: "system-ui";
}
}
</style>

View file

@ -4,10 +4,10 @@
</g>
</template>
<script lang="ts">
import { Vue, Component, Prop, Watch, Inject } from "vue-property-decorator";
import { Vue, Component, Prop, Watch, Inject } from 'vue-property-decorator';
import { UIData } from '../types/ui-data';
import { EventEmitter, Listener } from 'events';
import Piece from "./pieces/Piece.vue";
import Piece from './pieces/Piece.vue';
@Component
export default class DropZone extends Vue {
@ -39,7 +39,7 @@ export default class DropZone extends Vue {
if (!this.enabled || !this.ui.dragged) {
if (this.overlapping && this.enabled && !this.ui.dragged) {
if (this.accepts?.indexOf(piece.pieceType) != -1) {
this.communicator.emit("pieceDrop", piece, this.data);
this.communicator.emit('pieceDrop', piece, this.data);
}
}
@ -53,21 +53,21 @@ export default class DropZone extends Vue {
this.overlapping = rect1.bottom >= rect2.top && rect1.right >= rect2.left && rect1.top <= rect2.bottom && rect1.left <= rect2.right;
}
@Watch("enabled", { immediate: true })
@Watch('enabled', { immediate: true })
onEnabledChanged() {
if (!this.listener) {
this.listener = (piece) => this.updateOverlapping(piece);
this.$on("hook:beforeDestroy", () => this.communicator.off("draggedPosChanged", this.listener!));
this.$on('hook:beforeDestroy', () => this.communicator.off('draggedPosChanged', this.listener!));
}
if (this.enabled) {
if (this.communicator.listenerCount("draggedPosChanged") + 1 > this.communicator.getMaxListeners()) {
if (this.communicator.listenerCount('draggedPosChanged') + 1 > this.communicator.getMaxListeners()) {
this.communicator.setMaxListeners(this.communicator.getMaxListeners() + 10);
}
this.communicator.on("draggedPosChanged", this.listener!);
this.communicator.on('draggedPosChanged', this.listener!);
} else {
this.communicator.off("draggedPosChanged", this.listener!);
this.communicator.off('draggedPosChanged', this.listener!);
}
}
}
@ -84,5 +84,4 @@ g.placeholder {
cursor: pointer;
}
}
</style>

View file

@ -3,12 +3,12 @@
<div class="statusBar">
{{ getStatusMessage() }}
</div>
<svg viewBox="0 0 1250 650" height="650" id="scene">
<rect width="100%" height="100%" x="0" y="0" fill="lightblue"></rect>
<rect width="100%" height="100" x="0" y="0" fill="gray"></rect>
<rect width="390" height="220" x="860" y="430" fill="gray"></rect>
<svg id="scene" viewBox="0 0 1250 650" height="650">
<rect width="100%" height="100%" x="0" y="0" fill="lightblue" />
<rect width="100%" height="100" x="0" y="0" fill="gray" />
<rect width="390" height="220" x="860" y="430" fill="gray" />
<template v-if="G && G.currentPlayer == player">
<template v-if="isCurrentPlayer(player)">
<PassButton transform="translate(1130, 15)" @click="pass()" />
<UndoButton transform="translate(1130, 55)" @click="undo()" />
</template>
@ -16,16 +16,16 @@
<DropZone transform="translate(5, 5)" :width="600" :height="90" :enabled="true" :accepts="'container'" :data="{ type: 'supply' }" />
<template v-if="G">
<template v-for="(player, i) in G.players">
<template v-for="(p, i) in G.players">
<PlayerBoard :key="'B' + i"
:player="player"
:player="p"
:color="playerColors[i]"
:transform="`translate(${250 * i}, 100)`"
:owner="i"
:currentPlayer="G.currentPlayer == i"
:currentPlayer="isCurrentPlayer(i)"
:ended="gameEnded(G)"
@pieceDrop="onPieceDrop" />
<rect :key="'I' + i" width="390" height="41" x="860" :y="430 + i * 44" fill="none" stroke-width="3" :stroke="playerColors[i]"></rect>
<rect :key="'I' + i" width="390" height="41" x="860" :y="430 + i * 44" fill="none" stroke-width="3" :stroke="playerColors[i]" />
</template>
</template>
@ -33,7 +33,7 @@
<Ship :key="ship.id"
:pieceId="ship.id"
:targetState="{ x: ship.x, y: ship.y, rotate: ship.rotate }"
:canDrag="ship.owner == G.currentPlayer"
:canDrag="canDragShip(ship)"
:containers="ship.containers"
:color="ship.color" />
</template>
@ -82,11 +82,11 @@
<DropZone :transform="`translate(1045, 10)`" :width="40" :height="70" :enabled="true" :accepts="'loan'" :data="{ type: 'payLoan' }" />
<template v-if="G">
<template v-if="isCurrentPlayer(player)">
<Calculator v-if="G.phase == 'bid'" transform="translate(140, 430)" @bid="bid($event)" />
<template v-if="G.currentPlayer != undefined && G.currentPlayer == G.auctioningPlayer">
<template v-if="player == G.auctioningPlayer">
<template v-for="(bidder, i) in G.highestBidders">
<Button :key="bidder" :transform="`translate(140, ${450 + 40 * i})`" :width="130" :text="'Accept ' + G.players[bidder].name" @click="accept(bidder)" />
<Button :key="bidder" :transform="`translate(140, ${450 + 40 * i})`" :width="130" :text="'Accept ' + getName(bidder)" @click="accept(bidder)" />
</template>
<Button :transform="`translate(140, ${450 + 40 * G.highestBidders.length})`" :width="130" :text="'Decline'" @click="decline()" />
</template>
@ -98,105 +98,31 @@
</div>
</template>
<script lang="ts">
import { Vue, Component, Prop, Watch, Provide, ProvideReactive, } from "vue-property-decorator";
import { LogItem, AvailableMoves, Phase, reconstructState, MoveName, ended } from "container-engine";
import type { GameState } from "container-engine";
import { EventEmitter } from "events";
import { range, isEqual, groupBy } from "lodash";
import { ContainerState, DropZoneType, Piece, PieceType, ShipType, UIData } from "../types/ui-data";
import { logToText } from "../utils/log-to-text";
import { ContainerColor, ShipPosition } from "container-engine/src/gamestate";
import PlayerBoard from "./PlayerBoard.vue";
import Container from "./pieces/Container.vue";
import Factory from "./pieces/Factory.vue";
import Warehouse from "./pieces/Warehouse.vue";
import LoanCard from "./pieces/LoanCard.vue";
import PointCard from "./PointCard.vue";
import Ship from "./pieces/Ship.vue";
import Button from "./buttons/Button.vue";
import PassButton from "./buttons/PassButton.vue";
import UndoButton from "./buttons/UndoButton.vue";
import PieceComponent from "./pieces/Piece.vue";
import DropZone from "./DropZone.vue";
import Calculator from "./Calculator.vue";
import { Vue, Component, Prop, Watch, Provide, ProvideReactive, } from 'vue-property-decorator';
import { MoveName, ended, move as engineMove } from 'container-engine';
import type { GameState } from 'container-engine';
import { EventEmitter } from 'events';
import { groupBy } from 'lodash';
import { ContainerState, DropZoneType, Piece, PieceType, ShipType, UIData } from '../types/ui-data';
import { ContainerColor, ShipPosition } from 'container-engine/src/gamestate';
import PlayerBoard from './PlayerBoard.vue';
import Container from './pieces/Container.vue';
import Factory from './pieces/Factory.vue';
import Warehouse from './pieces/Warehouse.vue';
import LoanCard from './pieces/LoanCard.vue';
import PointCard from './PointCard.vue';
import Ship from './pieces/Ship.vue';
import Button from './buttons/Button.vue';
import PassButton from './buttons/PassButton.vue';
import UndoButton from './buttons/UndoButton.vue';
import PieceComponent from './pieces/Piece.vue';
import DropZone from './DropZone.vue';
import Calculator from './Calculator.vue';
@Component({
created(this: Game) {
this.emitter.on("addLog", this.addLog.bind(this));
this.emitter.on("replayStart", () => {
this.emitter.emit("replay:info", {
start: 1,
current: this.G!.log.length,
end: this._futureState!.log.length,
});
this.paused = true;
});
this.emitter.on("replayTo", (to: number) => {
console.log("replayTo", to);
if (to < this.G!.log.length) {
const baseState = {
players: this.G!.players.map((player, i) => ({
id: i,
pointCard: player.pointCard,
factories: player.factories,
warehouses: player.warehouses,
ship: { piece: { id: '' }, containers: [], shipPosition: ShipPosition.OpenSea },
containersOnFactoryStore: player.containersOnFactoryStore,
containersOnWarehouseStore: [],
containersOnIsland: [],
money: 20,
loans: [],
produced: [],
availableMoves: null,
lastMove: null,
actions: 0,
isDropped: false,
bid: 0,
additionalBid: 0,
showBid: false,
showAdditionalBid: false,
isAI: false
})),
startingPlayer: this.G!.startingPlayer,
currentPlayer: this.G!.currentPlayer,
containersLeft: this.G!.containersLeft,
factoriesLeft: this.G!.factoriesLeft,
warehousesLeft: this.G!.warehousesLeft,
loansLeft: this.G!.loansLeft,
auctioningPlayer: -1,
highestBidders: [],
phase: Phase.Move,
options: this.G!.options,
log: [],
seed: "",
round: 1
};
this.replaceState(reconstructState(baseState, this._futureState!.log.slice(0, to)), false);
}
if (this.G!.log.length + 1 === to) {
this.advanceLog();
} else if (this.G!.log.length + 1 < to) {
this.replaceState(reconstructState(this.G!, this._futureState!.log.slice(this.G!.log.length, to)), false);
}
this.emitter.emit("replay:info", {
start: 1,
current: this.G!.log.length,
end: this._futureState!.log.length,
});
});
this.emitter.on("replayEnd", () => {
this.paused = false;
this.emitter.emit("fetchState");
});
this.communicator.on("pieceDrop", this.onPieceDrop);
this.$on("hook:beforeDestroy", () => this.communicator.off("pieceDrop", this.onPieceDrop));
this.communicator.on('pieceDrop', this.onPieceDrop);
this.$on('hook:beforeDestroy', () => this.communicator.off('pieceDrop', this.onPieceDrop));
},
components: {
PlayerBoard,
@ -236,8 +162,8 @@ export default class Game extends Vue {
@ProvideReactive()
G?: GameState | null = null;
_futureState?: GameState;
// Pieces
containers: Piece[] = [];
factories: Piece[] = [];
warehouses: Piece[] = [];
@ -245,65 +171,19 @@ export default class Game extends Vue {
loanCards: Piece[] = [];
ships: ShipType[] = [];
currentMove = 0;
playerColors = ['dodgerblue', 'red', 'yellow', 'limegreen', 'mediumorchid'];
addLog({ log, availableMoves, start }: { log: LogItem[]; start: number; availableMoves: AvailableMoves[] }) {
// console.log("adding log...");
animationQueue: Array<Function> = [];
this._pendingAvailableMoves = null;
if (start > this._futureState!.log.length) {
this.emitter.emit("fetchState");
return;
}
if (log.length === 0) {
this.loadAvailableMoves(availableMoves);
return;
}
// edge case when we do a move and another player just did a move
if (start === this._futureState!.log.length && start > 0 && isEqual(log[0], this._futureState!.log.slice(-1)[0])) {
this.emitter.emit("fetchState");
return;
}
this._futureState!.log = [
...this._futureState!.log.slice(0, start),
...log,
];
this._pendingAvailableMoves = {
index: start + log.length,
availableMoves: availableMoves,
};
this.updateUI();
}
@Watch("state", { immediate: true })
@Watch('state', { immediate: true })
onStateChanged(state: GameState) {
this.replaceState(state);
}
replaceState(state: GameState, replaceFuture = true) {
// console.log("replace state", state, replaceFuture);
if (replaceFuture) {
this._futureState = state;
}
replaceState(state: GameState) {
this.G = JSON.parse(JSON.stringify(state));
if (this.G)
this.emitter.emit("uplink:replaceLog", [...this.G!.log.map((x: LogItem) => logToText(this.G!, x))].flat(1));
this.createPieces();
// if (this.G?.phase === Phase.Setup) {
// this._futureState?.log.push({ type: "phase", phase: Phase.Setup });
// this.advanceLog();
// }
}
createPieces() {
@ -434,7 +314,7 @@ export default class Game extends Vue {
// Ships
this.ships = [];
this.G?.players.forEach((player, pi) => {
const color = ["dodgerblue", "red", "yellow", "limegreen", "mediumorchid"][pi];
const color = ['dodgerblue', 'red', 'yellow', 'limegreen', 'mediumorchid'][pi];
switch (player.ship.shipPosition) {
case ShipPosition.OpenSea:
this.ships.push({ id: player.ship.piece.id, x: 380 + pi * 44, y: 480, rotate: 0, color, containers: player.ship.containers, owner: pi });
@ -467,31 +347,7 @@ export default class Game extends Vue {
});
}
get round() {
return this.G?.round;
}
get otherPlayers() {
if (!this.G) {
return [];
}
return range(0, this.G.players.length).filter(pl => pl !== (this.player || 0));
}
canPlayerMove(player: number) {
return !!this.G?.players[player]?.availableMoves;
}
loadAvailableMoves(availableMoves: AvailableMoves[]) {
for (let i = 0; i < availableMoves.length; i++) {
this.G!.players[i].availableMoves = availableMoves[i];
}
this._pendingAvailableMoves = null;
}
@Watch("ui.waitingAnimations")
@Watch('ui.waitingAnimations')
updateUI() {
if (this.ui.waitingAnimations > 0) {
return;
@ -502,116 +358,6 @@ export default class Game extends Vue {
setTimeout(() => this.updateUI());
return;
}
if (this.paused) {
return;
}
if (this.G!.log.length < this._futureState!.log.length) {
this.advanceLog();
setTimeout(() => this.updateUI());
return;
}
if (this._pendingAvailableMoves && this._pendingAvailableMoves.index === this.G!.log.length) {
// console.log("loading available moves", JSON.stringify(this._pendingAvailableMoves));
this.loadAvailableMoves(this._pendingAvailableMoves.availableMoves);
}
}
advanceLog() {
// console.log("advancing log", this.G!.log.length, this._futureState!.log.length);
const logItem = this._futureState!.log[this.G!.log.length];
this.G!.log.push(logItem);
this.emitter.emit("uplink:addLog", logToText(this.G!, logItem));
this.delay(1);
switch (logItem.type) {
case "phase": {
const { phase } = logItem;
// console.log("phase", phase);
switch (phase) {
case Phase.Setup: {
this.queueAnimation(() => {
this.delay(200);
});
for (let i = 0; i < this.G!.players.length; i++) {
this.queueAnimation(() => {
this.G?.players[i].warehouses.push(this.G?.warehousesLeft.pop()!);
this.createPieces();
});
}
return;
}
default:
return;
}
}
case "move": {
const { player, move } = logItem;
// console.log("move", player, move);
switch (move.name) {
default:
return;
}
}
case "event": {
const { event } = logItem;
// console.log("event", event);
switch (event.name) {
default:
return;
}
}
}
}
delay(ms: number) {
this.ui.waitingAnimations += 1;
setTimeout(() => { this.ui.waitingAnimations = Math.max(this.ui.waitingAnimations - 1, 0); }, ms);
}
queueAnimation(anim: Function) {
this.animationQueue.push(anim);
}
_pendingAvailableMoves: { index: number; availableMoves: AvailableMoves[]; } | null = null;
animationQueue: Array<Function> = [];
pass() {
this.emitter.emit("move", { name: MoveName.Pass, data: true });
}
undo() {
this.emitter.emit("move", { name: MoveName.Undo, data: true });
}
loan(event) {
const loan = event as LoanCard;
if (loan.owner == -1) {
this.emitter.emit("move", { name: MoveName.GetLoan, data: true });
} else if (loan.owner == this.G?.currentPlayer) {
this.emitter.emit("move", { name: MoveName.PayLoan, data: true });
}
}
bid(event) {
this.emitter.emit("move", { name: MoveName.Bid, data: true, extraData: { price: event } });
}
accept(bidder) {
this.emitter.emit("move", { name: MoveName.Accept, data: bidder });
}
decline() {
this.emitter.emit("move", { name: MoveName.Decline, data: true });
}
onPieceDrop(e: PieceComponent, d: any) {
@ -633,7 +379,9 @@ export default class Game extends Vue {
}
} else if (container.state == ContainerState.OnFactoryStore) {
if (d.type == DropZoneType.FactoryStore) {
this.sendMove({ name: MoveName.ArrangeFactory, data: { id: container.pieceId, color: container.color }, extraData: { price: d.price } });
const player = this.G!.players[this.G!.currentPlayer!];
if (player.containersOnFactoryStore.find(c => c.piece.id == e.pieceId)!.price !== d.price)
this.sendMove({ name: MoveName.ArrangeFactory, data: { id: container.pieceId, color: container.color }, extraData: { price: d.price } });
} else if (d.type == DropZoneType.WarehouseStore) {
this.sendMove({ name: MoveName.BuyFromFactory, data: { player: container.owner, piece: { id: container.pieceId, color: container.color } }, extraData: { price: d.price } });
} else if (d.type == DropZoneType.Supply) {
@ -652,12 +400,16 @@ export default class Game extends Vue {
break;
case PieceType.Ship:
const player = this.G!.players[this.G!.currentPlayer!];
if (d.type === DropZoneType.PlayerHarbour) {
this.sendMove({ name: MoveName.Sail, data: "player" + d.owner });
if (player.ship.shipPosition !== 'player' + d.owner)
this.sendMove({ name: MoveName.Sail, data: 'player' + d.owner });
} else if (d.type === DropZoneType.OpenSea) {
this.sendMove({ name: MoveName.Sail, data: ShipPosition.OpenSea });
if (player.ship.shipPosition !== ShipPosition.OpenSea)
this.sendMove({ name: MoveName.Sail, data: ShipPosition.OpenSea });
} else if (d.type === DropZoneType.IslandHarbor) {
this.sendMove({ name: MoveName.Sail, data: ShipPosition.Island });
if (player.ship.shipPosition !== ShipPosition.Island)
this.sendMove({ name: MoveName.Sail, data: ShipPosition.Island });
}
break;
@ -676,26 +428,59 @@ export default class Game extends Vue {
this.updateUI();
}
getName(bidder) {
return this.G!.players[bidder].name!.length > 8 ? this.G!.players[bidder].name?.substring(0, 5).concat('...') : this.G!.players[bidder].name;
}
pass() {
this.sendMove({ name: MoveName.Pass, data: true });
}
undo() {
this.sendMove({ name: MoveName.Undo, data: true });
}
loan(event) {
const loan = event as LoanCard;
if (loan.owner == -1) {
this.sendMove({ name: MoveName.GetLoan, data: true });
} else if (loan.owner == this.G?.currentPlayer) {
this.sendMove({ name: MoveName.PayLoan, data: true });
}
}
bid(event) {
this.sendMove({ name: MoveName.Bid, data: true, extraData: { price: event } });
}
accept(bidder) {
this.sendMove({ name: MoveName.Accept, data: bidder });
}
decline() {
this.sendMove({ name: MoveName.Decline, data: true });
}
sendMove(move) {
console.log("send move", move);
this.emitter.emit("move", move);
this.emitter.emit('move', move);
this.replaceState(engineMove(this.G!, move, this.player!, true));
}
gameEnded(G: GameState) {
return ended(G);
}
canDrag() {
return this.G?.currentPlayer == this.player! && this.G.players[this.player!] && this.G.players[this.player!].availableMoves;
}
canDragContainer(container: Piece) {
if (this.G?.currentPlayer == undefined)
if (!this.canDrag())
return false;
const currentPlayer = this.G.players[this.G.currentPlayer];
if (!currentPlayer)
return false;
const availableMoves = currentPlayer.availableMoves;
if (!availableMoves)
return false;
const currentPlayer = this.G!.players[this.G!.currentPlayer!];
const availableMoves = currentPlayer.availableMoves!;
switch (container.state) {
case ContainerState.OnBoard: {
@ -729,53 +514,38 @@ export default class Game extends Vue {
}
canDragFactory(factory: Piece) {
if (this.G?.currentPlayer == undefined)
if (!this.canDrag())
return false;
const currentPlayer = this.G!.players[this.G!.currentPlayer!];
const availableMoves = currentPlayer.availableMoves!;
if (factory.owner !== -1)
return false;
const currentPlayer = this.G.players[this.G.currentPlayer];
if (!currentPlayer)
return false;
const availableMoves = currentPlayer.availableMoves;
if (!availableMoves)
return false;
const available = availableMoves[MoveName.BuyFactory];
return available && available.find(a => a == factory.color);
}
canDragWarehouse(warehouse: Piece) {
if (this.G?.currentPlayer == undefined)
if (!this.canDrag())
return false;
const currentPlayer = this.G!.players[this.G!.currentPlayer!];
const availableMoves = currentPlayer.availableMoves!;
if (warehouse.owner !== -1)
return false;
const currentPlayer = this.G.players[this.G.currentPlayer];
if (!currentPlayer)
return false;
const availableMoves = currentPlayer.availableMoves;
if (!availableMoves)
return false;
return availableMoves[MoveName.BuyWarehouse] != undefined;
}
canDragLoan(loanCard: Piece) {
if (this.G?.currentPlayer == undefined)
if (!this.canDrag())
return false;
const currentPlayer = this.G.players[this.G.currentPlayer];
if (!currentPlayer)
return false;
const availableMoves = currentPlayer.availableMoves;
if (!availableMoves)
return false;
const currentPlayer = this.G!.players[this.G!.currentPlayer!];
const availableMoves = currentPlayer.availableMoves!;
if (loanCard.owner == -1) {
return availableMoves[MoveName.GetLoan] != undefined;
@ -786,15 +556,29 @@ export default class Game extends Vue {
return false;
}
canDragShip(ship: Piece) {
if (!this.canDrag())
return false;
const currentPlayer = this.G!.players[this.G!.currentPlayer!];
const availableMoves = currentPlayer.availableMoves!;
return availableMoves[MoveName.Sail] && this.isCurrentPlayer(ship.owner);
}
getStatusMessage() {
if (this.G?.currentPlayer == undefined) {
return "Game ended!";
return 'Game ended!';
} else if (this.G?.currentPlayer == this.player) {
return "It's your turn!";
return 'It\'s your turn!';
} else {
return `Waiting for ${this.G?.players[this.G!.currentPlayer!].name} to play...`;
return `Waiting for ${this.G?.players[this.G!.currentPlayer].name} to play...`;
}
}
isCurrentPlayer(player) {
return this.G && this.G.currentPlayer === player;
}
}
</script>
@ -841,4 +625,21 @@ text {
user-select: none;
}
.piece {
&:not(.dragging) {
transition: transform 0.8s ease-in-out;
}
&.canDrag {
cursor: pointer;
& > circle,
& > rect,
& > path {
&:hover {
stroke: white;
}
}
}
}
</style>

View file

@ -1,74 +1,74 @@
<template>
<g class="player-board">
<rect width="250" height="20" x="0" y="0" :fill="color"></rect>
<rect width="250" height="20" x="0" y="0" :fill="color" />
<text x="5" y="10" font-weight="600" fill="black" :text-decoration="currentPlayer ? 'underline' : ''">{{ getPlayerName() }}</text>
<rect width="250" height="180" x="0" y="20" fill="gray"></rect>
<rect width="250" height="180" x="0" y="20" fill="gray" />
<DropZone :transform="`translate(35, 200)`" :width="199" :height="80" :accepts="'ship'" :data="{ type: 'playerHarbor', owner: owner }" />
<rect width="20" height="80" x="0" y="200" fill="gray"></rect>
<rect width="20" height="80" x="62" y="200" fill="gray"></rect>
<rect width="20" height="80" x="124" y="200" fill="gray"></rect>
<rect width="20" height="80" x="186" y="200" fill="gray"></rect>
<rect width="20" height="80" x="0" y="200" fill="gray" />
<rect width="20" height="80" x="62" y="200" fill="gray" />
<rect width="20" height="80" x="124" y="200" fill="gray" />
<rect width="20" height="80" x="186" y="200" fill="gray" />
<DropZone :transform="`translate(200, 25)`" :width="40" :height="70" :enabled="currentPlayer" :accepts="'loan'" :data="{ type: 'getLoan' }" />
<DropZone :transform="`translate(13, 25)`" :width="174" :height="30" :enabled="currentPlayer" :accepts="'factory'" />
<circle r="14" cx="28" cy="40" fill="none" stroke="lightgray"></circle>
<circle r="14" cx="28" cy="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="28" y="40" fill="lightgray">-</text>
<circle r="14" cx="76" cy="40" fill="none" stroke="lightgray"></circle>
<circle r="14" cx="76" cy="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="76" y="40" fill="lightgray">6</text>
<circle r="14" cx="124" cy="40" fill="none" stroke="lightgray"></circle>
<circle r="14" cx="124" cy="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="124" y="40" fill="lightgray">9</text>
<circle r="14" cx="172" cy="40" fill="none" stroke="lightgray"></circle>
<circle r="14" cx="172" cy="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="171" y="40" fill="lightgray">12</text>
<DropZone :transform="`translate(12, 64)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 1 }" />
<rect x="8" y="60" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="8" y="60" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="28" y="90" fill="lightgray">1</text>
<DropZone :transform="`translate(60, 64)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 2 }" />
<rect x="56" y="60" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="56" y="60" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="76" y="90" fill="lightgray">2</text>
<DropZone :transform="`translate(108, 64)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 3 }" />
<rect x="104" y="60" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="104" y="60" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="124" y="90" fill="lightgray">3</text>
<DropZone :transform="`translate(156, 64)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 4 }" />
<rect x="152" y="60" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="152" y="60" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="172" y="90" fill="lightgray">4</text>
<DropZone :transform="`translate(7, 104)`" :width="234" :height="42" :enabled="currentPlayer" :accepts="'warehouse'" />
<rect x="8" y="105" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="8" y="105" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="28" y="125" fill="lightgray">-</text>
<rect x="56" y="105" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="56" y="105" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="76" y="125" fill="lightgray">4</text>
<rect x="104" y="105" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="104" y="105" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="124" y="125" fill="lightgray">5</text>
<rect x="152" y="105" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="152" y="105" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="172" y="125" fill="lightgray">6</text>
<rect x="200" y="105" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="200" y="105" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="220" y="125" fill="lightgray">7</text>
<DropZone :transform="`translate(12, 154)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 2 }" />
<rect x="8" y="150" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="8" y="150" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="28" y="180" fill="lightgray">2</text>
<DropZone :transform="`translate(60, 154)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 3 }" />
<rect x="56" y="150" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="56" y="150" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="76" y="180" fill="lightgray">3</text>
<DropZone :transform="`translate(108, 154)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 4 }" />
<rect x="104" y="150" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="104" y="150" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="124" y="180" fill="lightgray">4</text>
<DropZone :transform="`translate(156, 154)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 5 }" />
<rect x="152" y="150" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="152" y="150" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="172" y="180" fill="lightgray">5</text>
<DropZone :transform="`translate(204, 154)`" :width="32" :height="32" :enabled="currentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 6 }" />
<rect x="200" y="150" width="40" height="40" fill="none" stroke="lightgray"></rect>
<rect x="200" y="150" width="40" height="40" fill="none" stroke="lightgray" />
<text text-anchor="middle" x="220" y="180" fill="lightgray">6</text>
</g>
</template>
<script lang="ts">
import { Player } from "container-engine";
import { Vue, Component, Prop } from "vue-property-decorator";
import DropZone from "./DropZone.vue";
import { Player } from 'container-engine';
import { Vue, Component, Prop } from 'vue-property-decorator';
import DropZone from './DropZone.vue';
@Component({
components: {
@ -92,7 +92,7 @@ export default class PlayerBoard extends Vue {
ended?: boolean;
onPieceDrop(e) {
this.$emit("pieceDrop", e);
this.$emit('pieceDrop', e);
}
getPlayerName() {

View file

@ -1,26 +1,26 @@
<template>
<g class="point-card" @click="turned = !turned">
<g v-if="turned">
<rect width="100" height="160" fill="dimgray" stroke="white" stroke-width="2" rx="2"></rect>
<rect width="100" height="160" fill="dimgray" stroke="white" stroke-width="2" rx="2" />
</g>
<g v-else>
<rect width="100" height="160" fill="silver" stroke="white" stroke-width="2" rx="2"></rect>
<rect x="20" y="15" width="20" height="10" :fill="pointCard.containerValues[0].containerColor" stroke="black"></rect>
<rect width="100" height="160" fill="silver" stroke="white" stroke-width="2" rx="2" />
<rect x="20" y="15" width="20" height="10" :fill="pointCard.containerValues[0].containerColor" stroke="black" />
<text x="70" y="20" text-anchor="middle">10</text>
<rect x="20" y="45" width="20" height="10" :fill="pointCard.containerValues[1].containerColor" stroke="black"></rect>
<rect x="20" y="45" width="20" height="10" :fill="pointCard.containerValues[1].containerColor" stroke="black" />
<text x="70" y="50" text-anchor="middle">5/10</text>
<rect x="20" y="75" width="20" height="10" :fill="pointCard.containerValues[2].containerColor" stroke="black"></rect>
<rect x="20" y="75" width="20" height="10" :fill="pointCard.containerValues[2].containerColor" stroke="black" />
<text x="70" y="80" text-anchor="middle">6</text>
<rect x="20" y="105" width="20" height="10" :fill="pointCard.containerValues[3].containerColor" stroke="black"></rect>
<rect x="20" y="105" width="20" height="10" :fill="pointCard.containerValues[3].containerColor" stroke="black" />
<text x="70" y="110" text-anchor="middle">4</text>
<rect x="20" y="135" width="20" height="10" :fill="pointCard.containerValues[4].containerColor" stroke="black"></rect>
<rect x="20" y="135" width="20" height="10" :fill="pointCard.containerValues[4].containerColor" stroke="black" />
<text x="70" y="140" text-anchor="middle">2</text>
</g>
</g>
</template>
<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import type { PointCard as PointCardInfo } from "container-engine"
import { Vue, Component, Prop } from 'vue-property-decorator';
import type { PointCard as PointCardInfo } from 'container-engine'
@Component
export default class PointCard extends Vue {
@ -35,5 +35,4 @@ export default class PointCard extends Vue {
.point-card {
cursor: pointer;
}
</style>

View file

@ -1,12 +1,12 @@
<template>
<g :class="['container', {dragging}, {canDrag}]" :id="elId" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 10, 5)`">
<rect width="20" height="10" :fill="color" stroke="black"></rect>
<g :id="elId" :class="['piece', {dragging}, {canDrag}]" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 10, 5)`">
<rect width="20" height="10" :fill="color" stroke="black" />
</g>
</template>
<script lang="ts">
import { ContainerState, PieceType } from "@/types/ui-data";
import { Component, Mixins, Prop } from "vue-property-decorator";
import Piece from "./Piece.vue";
import { ContainerState, PieceType } from '@/types/ui-data';
import { Component, Mixins, Prop } from 'vue-property-decorator';
import Piece from './Piece.vue';
@Component({
created(this: Container) {
@ -24,24 +24,4 @@ export default class Container extends Mixins(Piece) {
state?: ContainerState;
}
</script>
<style lang="scss">
.container {
&:not(.dragging) {
transition-property: transform;
transition-duration: 0.8s;
transition-timing-function: ease-in-out;
}
&.canDrag {
cursor: pointer;
rect {
&:hover {
stroke: white;
}
}
}
}
</style>
</script>

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { Vue, Component, Prop } from "vue-property-decorator";
import { Vue, Component, Prop } from 'vue-property-decorator';
@Component({
mounted(this: Draggable) {
@ -7,7 +7,7 @@ import { Vue, Component, Prop } from "vue-property-decorator";
const endDrag = () => this.endDrag();
const drag = (event: MouseEvent | TouchEvent) => this.drag(event);
this.htmlElement.addEventListener("mousedown", event => this.startDrag(event));
this.htmlElement.addEventListener('mousedown', event => this.startDrag(event));
this.htmlElement.addEventListener('touchstart', event => this.startDrag(event));
this.svgElement.addEventListener('touchmove', drag);
@ -15,18 +15,18 @@ import { Vue, Component, Prop } from "vue-property-decorator";
this.svgElement.addEventListener('touchleave', endDrag);
this.svgElement.addEventListener('touchcancel', endDrag);
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("touchmove", drag));
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("touchend", endDrag));
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("touchleave", endDrag));
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("touchcancel", endDrag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('touchmove', drag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('touchend', endDrag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('touchleave', endDrag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('touchcancel', endDrag));
this.svgElement.addEventListener("mouseleave", endDrag);
this.svgElement.addEventListener("mouseup", endDrag);
this.svgElement.addEventListener("mousemove", drag);
this.svgElement.addEventListener('mouseleave', endDrag);
this.svgElement.addEventListener('mouseup', endDrag);
this.svgElement.addEventListener('mousemove', drag);
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("mouseleave", endDrag));
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("mouseup", endDrag));
this.$on("hook:beforeDestroy", () => this.svgElement.removeEventListener("mousemove", drag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('mouseleave', endDrag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('mouseup', endDrag));
this.$on('hook:beforeDestroy', () => this.svgElement.removeEventListener('mousemove', drag));
});
}
})
@ -40,7 +40,7 @@ export default class Draggable extends Vue {
_dragStart?: number;
get svgElement() {
return document.querySelector("#scene") as SVGSVGElement;
return document.querySelector('#scene') as SVGSVGElement;
}
get htmlElement() {
@ -81,13 +81,13 @@ export default class Draggable extends Vue {
const coord = this.getMousePosition(evt);
this._transform!.setTranslate(coord.x - this._offset.x, coord.y - this._offset.y);
this.$emit("draggedTo", { x: coord.x - this._offset.x, y: coord.y - this._offset.y });
this.$emit('draggedTo', { x: coord.x - this._offset.x, y: coord.y - this._offset.y });
}
endDrag() {
this.dragging = false;
if (Date.now() - this._dragStart! < 100) {
this.$nextTick(() => { this.$emit("fastClick", this); });
this.$nextTick(() => { this.$emit('fastClick', this); });
}
}

View file

@ -1,12 +1,12 @@
<template>
<g :class="['factory', {dragging}, {canDrag}]" :id="elId" :transform="`translate(${currentX}, ${currentY})`">
<circle r="10" :fill="color" stroke="black"></circle>
<g :id="elId" :class="['piece', {dragging}, {canDrag}]" :transform="`translate(${currentX}, ${currentY})`">
<circle r="10" :fill="color" stroke="black" />
</g>
</template>
<script lang="ts">
import { PieceType } from "@/types/ui-data";
import { Component, Mixins, Prop } from "vue-property-decorator";
import Piece from "./Piece.vue";
import { PieceType } from '@/types/ui-data';
import { Component, Mixins, Prop } from 'vue-property-decorator';
import Piece from './Piece.vue';
@Component({
created(this: Factory) {
@ -19,23 +19,3 @@ export default class Factory extends Mixins(Piece) {
}
</script>
<style lang="scss">
.factory {
&:not(.dragging) {
transition-property: transform;
transition-duration: 0.8s;
transition-timing-function: ease-in-out;
}
&.canDrag {
cursor: pointer;
circle {
&:hover {
stroke: white;
}
}
}
}
</style>

View file

@ -1,15 +1,15 @@
<template>
<g :class="['loan', {dragging}, {canDrag}]" :id="elId" :transform="`translate(${currentX}, ${currentY})`">
<rect width="30" height="60" fill="royalblue" stroke="white" stroke-width="2" rx="2"></rect>
<g :id="elId" :class="['loan', {dragging}, {canDrag}]" :transform="`translate(${currentX}, ${currentY})`">
<rect width="30" height="60" fill="royalblue" stroke="white" stroke-width="2" rx="2" />
<g transform="translate(33, -10) rotate(280, 15, 30)">
<text text-anchor="middle" fill="white">Loan</text>
</g>
</g>
</template>
<script lang="ts">
import { PieceType } from "@/types/ui-data";
import { Component, Mixins, Prop } from "vue-property-decorator";
import Piece from "./Piece.vue";
import { PieceType } from '@/types/ui-data';
import { Component, Mixins, Prop } from 'vue-property-decorator';
import Piece from './Piece.vue';
@Component({
created(this: LoanCard) {
@ -43,5 +43,4 @@ export default class LoanCard extends Mixins(Piece) {
}
}
}
</style>

View file

@ -1,16 +1,16 @@
<script lang="ts">
import { Component, Inject, Prop, Watch } from "vue-property-decorator";
import Draggable from "./Draggable.vue";
import { Component, Inject, Prop, Watch } from 'vue-property-decorator';
import Draggable from './Draggable.vue';
import { EventEmitter } from 'events';
import { PieceType, UIData } from "@/types/ui-data";
import { PieceType, UIData } from '@/types/ui-data';
@Component({
created(this: Piece) {
this.$on("draggedTo", (coords: { x: number, y: number }) => {
this.$on('draggedTo', (coords: { x: number, y: number }) => {
[this.currentX, this.currentY] = [coords.x, coords.y];
this.$nextTick(() => {
this.communicator.emit("draggedPosChanged", this);
this.communicator.emit('draggedPosChanged', this);
});
});
},
@ -30,7 +30,7 @@ export default class Piece extends Draggable {
};
@Prop()
pieceId!: number;
pieceId!: string;
@Inject()
readonly communicator!: EventEmitter;
@ -68,8 +68,8 @@ export default class Piece extends Draggable {
}, 1000);
}
@Watch("dragging")
@Watch("targetState", { immediate: true })
@Watch('dragging')
@Watch('targetState', { immediate: true })
onTargetChanged(newVal: boolean, oldVal: boolean) {
if (this.dragging) {
return;
@ -102,13 +102,13 @@ export default class Piece extends Draggable {
}
}
@Watch("dragging")
@Watch('dragging')
onDraggingChanged() {
if (this.dragging) {
this.ui.dragged = this;
} else {
this.ui.dragged = null;
this.communicator.emit("draggedPosChanged", this);
this.communicator.emit('draggedPosChanged', this);
}
}

View file

@ -1,23 +1,23 @@
<template>
<g :class="['ship', {dragging}, {canDrag}]" :id="elId" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 15, 40)`">
<path d="M15 0 L30 10 L30 80 L0 80 L0 10Z" :fill="color" stroke="black"></path>
<g :id="elId" :class="['piece', {dragging}, {canDrag}]" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 15, 40)`">
<path d="M15 0 L30 10 L30 80 L0 80 L0 10Z" :fill="color" stroke="black" />
<template v-for="(container, i) in containers">
<Container :key="container.id"
:pieceId="container.id"
:targetState="{ x: 5, y: 15 + 12 * i, rotate: 0 }"
:canDrag="false"
:color="container.color" />
:pieceId="container.id"
:targetState="{ x: 5, y: 15 + 12 * i, rotate: 0 }"
:canDrag="false"
:color="container.color" />
</template>
<DropZone :width="30" :height="80" :enabled="true" :accepts="'container'" :data="{ type: 'ship' }" />
</g>
</template>
<script lang="ts">
import { PieceType } from "@/types/ui-data";
import { ContainerPiece } from "container-engine/src/gamestate";
import { Component, Mixins, Prop } from "vue-property-decorator";
import Piece from "./Piece.vue";
import Container from "./Container.vue";
import DropZone from "../DropZone.vue";
import { PieceType } from '@/types/ui-data';
import { ContainerPiece } from 'container-engine/src/gamestate';
import { Component, Mixins, Prop } from 'vue-property-decorator';
import Piece from './Piece.vue';
import Container from './Container.vue';
import DropZone from '../DropZone.vue';
@Component({
created(this: Ship) {
@ -36,24 +36,4 @@ export default class Ship extends Mixins(Piece) {
containers?: ContainerPiece[];
}
</script>
<style lang="scss">
.ship {
&:not(.dragging) {
transition-property: transform;
transition-duration: 0.8s;
transition-timing-function: ease-in-out;
}
&.canDrag {
cursor: pointer;
path {
&:hover {
stroke: white;
}
}
}
}
</style>
</script>

View file

@ -1,12 +1,12 @@
<template>
<g :class="['warehouse', {dragging}, {canDrag}]" :id="elId" :transform="`translate(${currentX}, ${currentY})`">
<path d="M15 0 L30 10 L30 30 L0 30 L0 10Z" fill="dimgray" stroke="black"></path>
<g :id="elId" :class="['piece', {dragging}, {canDrag}]" :transform="`translate(${currentX}, ${currentY})`">
<path d="M15 0 L30 10 L30 30 L0 30 L0 10Z" fill="dimgray" stroke="black" />
</g>
</template>
<script lang="ts">
import { PieceType } from "@/types/ui-data";
import { Component, Mixins } from "vue-property-decorator";
import Piece from "./Piece.vue";
import { PieceType } from '@/types/ui-data';
import { Component, Mixins } from 'vue-property-decorator';
import Piece from './Piece.vue';
@Component({
created(this: Warehouse) {
@ -17,23 +17,3 @@ export default class Warehouse extends Mixins(Piece) {
}
</script>
<style lang="scss">
.warehouse {
&:not(.dragging) {
transition-property: transform;
transition-duration: 0.8s;
transition-timing-function: ease-in-out;
}
&.canDrag {
cursor: pointer;
path {
&:hover {
stroke: white;
}
}
}
}
</style>

View file

@ -1,7 +1,6 @@
import type { Move, GameState } from "container-engine";
import Vue from "vue";
import type { GameState, Move } from 'container-engine';
import { EventEmitter } from 'events';
import Vue from 'vue';
import Game from './components/Game.vue';
function launch(selector: string) {
@ -12,47 +11,20 @@ function launch(selector: string) {
}).$mount(selector);
const item: EventEmitter = new EventEmitter();
let replaying = false;
params.emitter.on("move", (move: Move) => item.emit("move", move));
params.emitter.on("fetchState", () => item.emit("fetchState"));
params.emitter.on("uplink:addLog", (data: string[]) => item.emit("addLog", data));
params.emitter.on("uplink:replaceLog", (data: string[]) => item.emit("replaceLog", data));
params.emitter.on("replay:info", (info: { start: number, current: number, end: number }) => item.emit("replay:info", info));
params.emitter.on('move', (move: Move) => item.emit('move', move));
item.addListener("state", data => {
// console.log("updating state to", data);
item.addListener('state', data => {
params.state = data;
app.$forceUpdate();
app.$nextTick().then(() => item.emit('ready'))
app.$nextTick().then(() => item.emit('ready'));
});
item.addListener("state:updated", () => item.emit("fetchLog", { start: params.state?.log.length }));
item.addListener("player", data => {
item.addListener('state:updated', () => item.emit('fetchState'));
item.addListener('player', data => {
params.player = data.index;
app.$forceUpdate();
});
item.addListener("replay:start", () => {
params.emitter.emit("replayStart");
replaying = true;
});
item.addListener("replay:to", (info) => {
params.emitter.emit("replayTo", info);
// Todo: change log ?
// item.emit("replaceLog", (store.state as any).gaiaViewer.data.moveHistory);
})
item.addListener("replay:end", () => {
params.emitter.emit("replayEnd");
replaying = false;
item.emit("fetchState");
});
item.addListener("gamelog", logData => {
if (replaying) {
return;
}
// console.log("receiving log data", logData);
params.emitter.emit("addLog", { start: logData.start, log: logData.data.log, availableMoves: logData.data.availableMoves });
});
item.addListener('gamelog', _ => item.emit('fetchState'));
return item;
}

View file

@ -1,9 +1,9 @@
import launch from './launch';
import { setup, Move, move as execMove, stripSecret } from "container-engine";
import { cloneDeep } from "lodash";
import { move as execMove, Move, setup, stripSecret } from 'container-engine';
import { moveAI } from 'container-engine/src/engine';
import { cloneDeep } from 'lodash';
import launch from './launch';
function launchSelfContained(selector = "#app") {
function launchSelfContained(selector = '#app') {
const strip = false;
const emitter = launch(selector);
@ -18,37 +18,31 @@ function launchSelfContained(selector = "#app") {
player.isAI = true;
}
emitter.on("move", async (move: Move) => {
console.log("move received", JSON.stringify(move));
gameState = execMove(gameState, move, gameState.currentPlayer!);
emitter.on('move', async (move: Move) => {
gameState = execMove(gameState, move, 0);
emitter.emit("state", cloneDeep(strip ? stripSecret(gameState, 0) : gameState));
emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, 0) : gameState));
let delay = 0;
let delay = 800;
while (gameState.players.some(pl => pl.isAI && pl.availableMoves)) {
gameState = moveAI(gameState, gameState.players.findIndex(pl => pl.isAI && pl.availableMoves));
let newState = cloneDeep(strip ? stripSecret(gameState, 0) : gameState);
setTimeout(() => emitter.emit("state", newState), delay);
delay += 400;
setTimeout(() => emitter.emit('state', newState), delay);
delay += 800;
}
});
emitter.on('fetchSate', () => emitter.emit("state", cloneDeep(strip ? stripSecret(gameState, 0) : gameState)));
emitter.on('fetchSate', () => emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, 0) : gameState)));
// emitter.on('addLog', data => console.log('addLog', data));
// emitter.on('replaceLog', data => console.log('replaceLog', data));
emitter.emit('player', { index: 0 });
emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, 0) : gameState));
emitter.emit("player", { index: 0 });
emitter.emit("state", cloneDeep(strip ? stripSecret(gameState, 0) : gameState));
if (gameState.players[gameState.currentPlayer!].isAI) {
let delay = 0;
while (gameState.players.some(pl => pl.isAI && pl.availableMoves)) {
gameState = moveAI(gameState, gameState.players.findIndex(pl => pl.isAI && pl.availableMoves));
let newState = cloneDeep(strip ? stripSecret(gameState, 0) : gameState);
setTimeout(() => emitter.emit("state", newState), delay);
delay += 400;
}
let delay = 800;
while (gameState.players.some(pl => pl.isAI && pl.availableMoves)) {
gameState = moveAI(gameState, gameState.players.findIndex(pl => pl.isAI && pl.availableMoves));
let newState = cloneDeep(strip ? stripSecret(gameState, 0) : gameState);
setTimeout(() => emitter.emit('state', newState), delay);
delay += 800;
}
}

View file

@ -1,7 +1,8 @@
import { ContainerPiece } from 'container-engine/src/gamestate';
import PieceComponent from '../components/pieces/Piece.vue';
export interface UIData {
dragged?: Vue | null;
dragged?: PieceComponent | null;
waitingAnimations: number;
}
@ -20,31 +21,31 @@ export interface ShipType extends Piece {
}
export enum PieceType {
Warehouse = "warehouse",
Factory = "factory",
Container = "container",
Ship = "ship",
Loan = "loan"
Warehouse = 'warehouse',
Factory = 'factory',
Container = 'container',
Ship = 'ship',
Loan = 'loan'
}
export enum DropZoneType {
Ship = "ship",
PlayerHarbour = "playerHarbor",
Factory = "factory",
FactoryStore = "factoryStore",
Warehouse = "warehouse",
WarehouseStore = "warehouseStore",
OpenSea = "openSea",
IslandHarbor = "islandHarbor",
GetLoan = "getLoan",
PayLoan = "payLoan",
Supply = "supply"
Ship = 'ship',
PlayerHarbour = 'playerHarbor',
Factory = 'factory',
FactoryStore = 'factoryStore',
Warehouse = 'warehouse',
WarehouseStore = 'warehouseStore',
OpenSea = 'openSea',
IslandHarbor = 'islandHarbor',
GetLoan = 'getLoan',
PayLoan = 'payLoan',
Supply = 'supply'
}
export enum ContainerState {
OnBoard = "onBoard",
OnFactoryStore = "onFactoryStore",
OnWarehouseStore = "onWarehouseStore",
OnShip = "onShip",
OnIsland = "onIsland"
OnBoard = 'onBoard',
OnFactoryStore = 'onFactoryStore',
OnWarehouseStore = 'onWarehouseStore',
OnShip = 'onShip',
OnIsland = 'onIsland'
}

View file

@ -1,52 +0,0 @@
import { LogItem, GameState, MoveName, Phase, GameEventName } from 'container-engine';
export function logToText(G: GameState, item: LogItem): string[] {
return [];
// switch (item.type) {
// case "move": {
// switch (item.move.name) {
// case MoveName.ChooseCard: return [`${G.players[item.player].name} made their choice`];
// case MoveName.PlaceCard: {
// const ret = [`${G.players[item.player].name} placed their card on row ${item.move.data.row + 1}`]
// if (item.move.data.replace) {
// ret.push(`**${G.players[item.player].name} takes the row!!**`);
// }
// return ret;
// }
// }
// }
// case "phase": {
// switch (item.phase) {
// case Phase.ChooseCard:
// return ["*Time to make a choice!*"];
// case Phase.PlaceCard:
// return ["*Here we go!*"];
// }
// }
// case "event": {
// switch (item.event.name) {
// case GameEventName.GameStart:
// return ["**Game started!!**"];
// case GameEventName.GameEnd:
// return ["**Game ended!!**"];
// case GameEventName.RevealCards: {
// const ret: string[] = [];
// item.event.cards.forEach((card, i) => {
// ret.push(`${G.players[i].name} reveals ${card.number} (${new Array(card.points).fill('★').join('')})`);
// });
// return ret;
// }
// case GameEventName.RoundStart: {
// return [`**Round ${item.event.round}**`];
// }
// }
// }
// }
}