Add continuous integration
This commit is contained in:
parent
7220b4aace
commit
50b57cb24d
59 changed files with 17229 additions and 12421 deletions
40
.github/workflows/engine-publish.yml
vendored
Normal file
40
.github/workflows/engine-publish.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Engine - Version and Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
newversion:
|
||||
description: 'Semantic Version Bump Type (major minor patch)'
|
||||
default: patch
|
||||
|
||||
env:
|
||||
node_version: 14
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: engine
|
||||
|
||||
jobs:
|
||||
version_and_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ env.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.node_version }}
|
||||
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 5.17.1
|
||||
- run: pnpm install
|
||||
- run: git config --global user.name github-actions
|
||||
- run: git config --global user.email bot@github.com
|
||||
- run: yarn config set version-git-message "Engine v%s"
|
||||
- run: yarn version --${{ github.event.inputs.newversion }}
|
||||
- run: sed -i 's/container-engine/@boardgamers\\/container-engine/' package.json
|
||||
- run: pnpm publish --access public .
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- run: git push --follow-tags
|
||||
30
.github/workflows/engine-test.yml
vendored
Normal file
30
.github/workflows/engine-test.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
name: Engine - Test
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/engine-test.yml'
|
||||
- 'engine/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/engine-test.yml'
|
||||
- 'engine/**'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: engine
|
||||
|
||||
jobs:
|
||||
lint_and_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '12'
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 5.17.1
|
||||
- run: pnpm install
|
||||
- run: pnpm build
|
||||
- run: pnpm lint
|
||||
- run: pnpm test
|
||||
14
.github/workflows/prettier.yml
vendored
Normal file
14
.github/workflows/prettier.yml
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
name: All
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 5.17.1
|
||||
- run: pnpm install
|
||||
- run: pnpm run prettier-check
|
||||
40
.github/workflows/viewer-publish.yml
vendored
Normal file
40
.github/workflows/viewer-publish.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Viewer - Version and Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
newversion:
|
||||
description: 'Semantic Version Bump Type (major minor patch)'
|
||||
default: patch
|
||||
|
||||
env:
|
||||
node_version: 14
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: viewer
|
||||
|
||||
jobs:
|
||||
version_and_release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ env.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.node_version }}
|
||||
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 5.17.1
|
||||
- run: pnpm install
|
||||
- run: git config --global user.name github-actions
|
||||
- run: git config --global user.email bot@github.com
|
||||
- run: yarn config set version-git-message "Viewer v%s"
|
||||
- run: yarn version --${{ github.event.inputs.newversion }}
|
||||
- run: sed -i 's/container-viewer/@boardgamers\\/container-viewer/' package.json
|
||||
- run: pnpm publish --access public .
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- run: git push --follow-tags
|
||||
32
.github/workflows/viewer-test.yml
vendored
Normal file
32
.github/workflows/viewer-test.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: Viewer - Test
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- '.github/workflows/viewer-test.yml'
|
||||
- 'viewer/**'
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/viewer-test.yml'
|
||||
- 'viewer/**'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: viewer
|
||||
|
||||
jobs:
|
||||
test_and_build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
- uses: pnpm/action-setup@v1.2.1
|
||||
with:
|
||||
version: 5.17.1
|
||||
- run: pnpm install
|
||||
# - run: pnpm lint
|
||||
# - run: pnpm test
|
||||
- run: pnpm build
|
||||
4
.husky/pre-commit
Normal file
4
.husky/pre-commit
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
pnpm run lint-staged
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
{
|
||||
"tabWidth": 4
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true,
|
||||
"printWidth": 120
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
env: {
|
||||
node: true
|
||||
node: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020
|
||||
ecmaVersion: 2020,
|
||||
},
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: [
|
||||
'@typescript-eslint',
|
||||
],
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
|
|
@ -23,15 +21,14 @@ module.exports = {
|
|||
// '@typescript-eslint/consistent-type-assertions': 'off',
|
||||
// '@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/no-unused-vars': ["warn", { "argsIgnorePattern": "^_" }],
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/explicit-function-return-type': 'off',
|
||||
'@typescript-eslint/no-use-before-define': 'off',
|
||||
'@typescript-eslint/no-namespace': 'off',
|
||||
'no-inner-declarations': 'off',
|
||||
'no-return-assign': 'off',
|
||||
// 'no-fallthrough': 'off',
|
||||
quotes: 'off',
|
||||
'no-empty': 'off',
|
||||
'quotes': ['error', 'single']
|
||||
}
|
||||
quotes: ['error', 'single'],
|
||||
},
|
||||
};
|
||||
|
|
|
|||
1
engine/.gitignore
vendored
Normal file
1
engine/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/dist
|
||||
10
engine/.vscode/launch.json
vendored
10
engine/.vscode/launch.json
vendored
|
|
@ -14,20 +14,16 @@
|
|||
"--slow",
|
||||
"5000",
|
||||
"--colors",
|
||||
"${workspaceFolder}/src/*.spec.ts",
|
||||
"${workspaceFolder}/src/*.spec.ts"
|
||||
],
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
]
|
||||
"skipFiles": ["<node_internals>/**"]
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"program": "${workspaceFolder}/index.js"
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
export { setup, currentPlayers, move, stripSecret, ended, reconstructState } from './src/engine';
|
||||
export type { GameState, Player, PointCard } from './src/gamestate';
|
||||
export { MoveName, Move, Moves } from './src/move';
|
||||
export { Phase } from './src/gamestate';
|
||||
export { GameEventName, LogItem } from './src/log';
|
||||
export { availableMoves, AvailableMoves } from './src/available-moves';
|
||||
export { currentPlayers, ended, move, reconstructState, setup, stripSecret } from './src/engine';
|
||||
export { Phase } from './src/gamestate';
|
||||
export type { GameState, Player, PointCard } from './src/gamestate';
|
||||
export { GameEventName, LogItem } from './src/log';
|
||||
export { Move, MoveName, Moves } from './src/move';
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"scripts": {
|
||||
"prepublishOnly": "npm run test && npm run clean && tsc",
|
||||
"build": "npm run clean && tsc",
|
||||
"clean": "del /q dist",
|
||||
"clean": "rm -Rf dist",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"test": "mocha -r ts-node/register src/**/*.spec.ts src/*.spec.ts"
|
||||
},
|
||||
|
|
|
|||
1021
engine/pnpm-lock.yaml
generated
1021
engine/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -4,8 +4,14 @@ import { MoveName } from './move';
|
|||
|
||||
export interface AvailableMoves {
|
||||
[MoveName.DomesticSale]?: ContainerPiece[];
|
||||
[MoveName.BuyFromFactory]?: Array<{ player: number; piece: ContainerPiece }>;
|
||||
[MoveName.BuyFromWarehouse]?: Array<{ player: number; piece: ContainerPiece }>;
|
||||
[MoveName.BuyFromFactory]?: Array<{
|
||||
player: number;
|
||||
piece: ContainerPiece;
|
||||
}>;
|
||||
[MoveName.BuyFromWarehouse]?: Array<{
|
||||
player: number;
|
||||
piece: ContainerPiece;
|
||||
}>;
|
||||
[MoveName.BuyFactory]?: ContainerColor[];
|
||||
[MoveName.BuyWarehouse]?: boolean[];
|
||||
[MoveName.GetLoan]?: boolean[];
|
||||
|
|
@ -25,37 +31,31 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
switch (G.phase) {
|
||||
case Phase.Bid: {
|
||||
const moves = {
|
||||
[MoveName.Bid]: [true]
|
||||
[MoveName.Bid]: [true],
|
||||
};
|
||||
|
||||
if (player.loans.length < 2)
|
||||
moves[MoveName.GetLoan] = [true];
|
||||
|
||||
if (player.loans.length < 2) moves[MoveName.GetLoan] = [true];
|
||||
|
||||
// Undo
|
||||
const lastLog = G.log[G.log.length - 1];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer)
|
||||
moves[MoveName.Undo] = [true];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer) moves[MoveName.Undo] = [true];
|
||||
|
||||
return moves;
|
||||
}
|
||||
|
||||
case Phase.AcceptDecline: {
|
||||
const moves: AvailableMoves = {
|
||||
[MoveName.Accept]: G.highestBidders
|
||||
[MoveName.Accept]: G.highestBidders,
|
||||
};
|
||||
|
||||
if (player.loans.length < 2)
|
||||
moves[MoveName.GetLoan] = [true];
|
||||
if (player.loans.length < 2) moves[MoveName.GetLoan] = [true];
|
||||
|
||||
const highestBidder = G.players[G.highestBidders[0]];
|
||||
if (player.money >= highestBidder.bid + highestBidder.additionalBid)
|
||||
moves[MoveName.Decline] = [true];
|
||||
if (player.money >= highestBidder.bid + highestBidder.additionalBid) moves[MoveName.Decline] = [true];
|
||||
|
||||
// Undo
|
||||
const lastLog = G.log[G.log.length - 1];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer)
|
||||
moves[MoveName.Undo] = [true];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer) moves[MoveName.Undo] = [true];
|
||||
|
||||
return moves;
|
||||
}
|
||||
|
|
@ -66,32 +66,54 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
// DomesticSale
|
||||
if (player.actions > 0 && G.round > 1) {
|
||||
if (player.containersOnFactoryStore.length > 0) {
|
||||
moves[MoveName.DomesticSale] = player.containersOnFactoryStore.map(c => c.piece);
|
||||
moves[MoveName.DomesticSale] = player.containersOnFactoryStore.map((c) => c.piece);
|
||||
} else if (player.containersOnWarehouseStore.length > 0) {
|
||||
moves[MoveName.DomesticSale] = player.containersOnWarehouseStore.map(c => c.piece);
|
||||
moves[MoveName.DomesticSale] = player.containersOnWarehouseStore.map((c) => c.piece);
|
||||
}
|
||||
}
|
||||
|
||||
// BuyFromFactory
|
||||
if (player.actions > 0 || player.lastMove?.name === MoveName.BuyFromFactory) {
|
||||
if (player.containersOnWarehouseStore.length < player.warehouses.length) {
|
||||
const containersAvailable: { player: number; container: ContainerOnStore }[] = [];
|
||||
const playersToBuy: Player[] = player.actions === 0 && player.lastMove?.name === MoveName.BuyFromFactory ?
|
||||
[G.players[player.lastMove.data.player]] : G.players.filter(p => p.id !== player.id);
|
||||
playersToBuy.forEach(p => {
|
||||
containersAvailable.push(...p.containersOnFactoryStore.map(c => ({ player: p.id, container: c })));
|
||||
const containersAvailable: {
|
||||
player: number;
|
||||
container: ContainerOnStore;
|
||||
}[] = [];
|
||||
const playersToBuy: Player[] =
|
||||
player.actions === 0 && player.lastMove?.name === MoveName.BuyFromFactory
|
||||
? [G.players[player.lastMove.data.player]]
|
||||
: G.players.filter((p) => p.id !== player.id);
|
||||
playersToBuy.forEach((p) => {
|
||||
containersAvailable.push(
|
||||
...p.containersOnFactoryStore.map((c) => ({
|
||||
player: p.id,
|
||||
container: c,
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
const buyable = containersAvailable.filter(c => c.container.price <= player.money).map(c => ({ player: c.player, piece: c.container.piece }));
|
||||
const buyable = containersAvailable
|
||||
.filter((c) => c.container.price <= player.money)
|
||||
.map((c) => ({
|
||||
player: c.player,
|
||||
piece: c.container.piece,
|
||||
}));
|
||||
|
||||
if (buyable.length > 0)
|
||||
moves[MoveName.BuyFromFactory] = buyable;
|
||||
if (buyable.length > 0) moves[MoveName.BuyFromFactory] = buyable;
|
||||
}
|
||||
}
|
||||
|
||||
// BuyFromWarehouse
|
||||
if (player.actions > 0 || player.lastMove?.name === MoveName.Sail || player.lastMove?.name === MoveName.BuyFromWarehouse) {
|
||||
if (player.ship.shipPosition !== ShipPosition.Island && player.ship.shipPosition !== ShipPosition.OpenSea && player.ship.containers.length < 5) {
|
||||
if (
|
||||
player.actions > 0 ||
|
||||
player.lastMove?.name === MoveName.Sail ||
|
||||
player.lastMove?.name === MoveName.BuyFromWarehouse
|
||||
) {
|
||||
if (
|
||||
player.ship.shipPosition !== ShipPosition.Island &&
|
||||
player.ship.shipPosition !== ShipPosition.OpenSea &&
|
||||
player.ship.containers.length < 5
|
||||
) {
|
||||
let otherPlayer: Player;
|
||||
switch (player.ship.shipPosition) {
|
||||
case ShipPosition.PlayerHarbor01:
|
||||
|
|
@ -131,14 +153,19 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
}
|
||||
|
||||
if (otherPlayer.containersOnWarehouseStore.length > 0) {
|
||||
const buyable: { player: number; piece: ContainerPiece }[] = [];
|
||||
otherPlayer.containersOnWarehouseStore.forEach(c => {
|
||||
const buyable: {
|
||||
player: number;
|
||||
piece: ContainerPiece;
|
||||
}[] = [];
|
||||
otherPlayer.containersOnWarehouseStore.forEach((c) => {
|
||||
if (c.price <= player.money)
|
||||
buyable.push({ player: otherPlayer.id, piece: c.piece });
|
||||
buyable.push({
|
||||
player: otherPlayer.id,
|
||||
piece: c.piece,
|
||||
});
|
||||
});
|
||||
|
||||
if (buyable.length > 0)
|
||||
moves[MoveName.BuyFromWarehouse] = buyable;
|
||||
if (buyable.length > 0) moves[MoveName.BuyFromWarehouse] = buyable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -146,13 +173,15 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
// BuyFactory
|
||||
if (player.actions > 0 && player.money >= (player.factories.length + 1) * 3) {
|
||||
const factoriesLeft: ContainerColor[] = [];
|
||||
Object.values(ContainerColor).forEach(color => {
|
||||
if (G.factoriesLeft.filter(f => f.color.toString() === color).length > 0 && player.factories.map(f => f.color).indexOf(color) == -1)
|
||||
Object.values(ContainerColor).forEach((color) => {
|
||||
if (
|
||||
G.factoriesLeft.filter((f) => f.color.toString() === color).length > 0 &&
|
||||
player.factories.map((f) => f.color).indexOf(color) == -1
|
||||
)
|
||||
factoriesLeft.push(color);
|
||||
});
|
||||
|
||||
if (factoriesLeft.length > 0)
|
||||
moves[MoveName.BuyFactory] = factoriesLeft;
|
||||
if (factoriesLeft.length > 0) moves[MoveName.BuyFactory] = factoriesLeft;
|
||||
}
|
||||
|
||||
// BuyWarehouse
|
||||
|
|
@ -162,24 +191,30 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
}
|
||||
|
||||
// GetLoan
|
||||
if (player.loans.length < 2)
|
||||
moves[MoveName.GetLoan] = [true];
|
||||
if (player.loans.length < 2) moves[MoveName.GetLoan] = [true];
|
||||
|
||||
// PayLoan
|
||||
if (player.loans.length > 0 && player.money >= 10)
|
||||
moves[MoveName.PayLoan] = [true];
|
||||
if (player.loans.length > 0 && player.money >= 10) moves[MoveName.PayLoan] = [true];
|
||||
|
||||
// ArrangeFactory
|
||||
if (player.actions > 0 || player.lastMove?.name === MoveName.Produce || player.lastMove?.name === MoveName.ArrangeFactory) {
|
||||
if (
|
||||
player.actions > 0 ||
|
||||
player.lastMove?.name === MoveName.Produce ||
|
||||
player.lastMove?.name === MoveName.ArrangeFactory
|
||||
) {
|
||||
if (player.containersOnFactoryStore.length > 0) {
|
||||
moves[MoveName.ArrangeFactory] = player.containersOnFactoryStore.map(c => c.piece);
|
||||
moves[MoveName.ArrangeFactory] = player.containersOnFactoryStore.map((c) => c.piece);
|
||||
}
|
||||
}
|
||||
|
||||
// ArrangeWarehouse
|
||||
if (player.actions > 0 || player.lastMove?.name === MoveName.BuyFromFactory || player.lastMove?.name === MoveName.ArrangeWarehouse) {
|
||||
if (
|
||||
player.actions > 0 ||
|
||||
player.lastMove?.name === MoveName.BuyFromFactory ||
|
||||
player.lastMove?.name === MoveName.ArrangeWarehouse
|
||||
) {
|
||||
if (player.containersOnWarehouseStore.length > 0) {
|
||||
moves[MoveName.ArrangeWarehouse] = player.containersOnWarehouseStore.map(c => c.piece);
|
||||
moves[MoveName.ArrangeWarehouse] = player.containersOnWarehouseStore.map((c) => c.piece);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -187,12 +222,28 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
if (player.actions > 0) {
|
||||
const positions: ShipPosition[] = [];
|
||||
if (player.ship.shipPosition === ShipPosition.OpenSea) {
|
||||
positions.push(...G.players.filter(p => p !== player).map(p => ShipPosition['PlayerHarbor' + p.id + '1' as keyof ShipPosition]));
|
||||
positions.push(...G.players.filter(p => p !== player).map(p => ShipPosition['PlayerHarbor' + p.id + '2' as keyof ShipPosition]));
|
||||
positions.push(...G.players.filter(p => p !== player).map(p => ShipPosition['PlayerHarbor' + p.id + '3' as keyof ShipPosition]));
|
||||
positions.push(...G.players.filter(p => p !== player).map(p => ShipPosition['PlayerHarbor' + p.id + '4' as keyof ShipPosition]));
|
||||
positions.push(
|
||||
...G.players
|
||||
.filter((p) => p !== player)
|
||||
.map((p) => ShipPosition[('PlayerHarbor' + p.id + '1') as keyof ShipPosition])
|
||||
);
|
||||
positions.push(
|
||||
...G.players
|
||||
.filter((p) => p !== player)
|
||||
.map((p) => ShipPosition[('PlayerHarbor' + p.id + '2') as keyof ShipPosition])
|
||||
);
|
||||
positions.push(
|
||||
...G.players
|
||||
.filter((p) => p !== player)
|
||||
.map((p) => ShipPosition[('PlayerHarbor' + p.id + '3') as keyof ShipPosition])
|
||||
);
|
||||
positions.push(
|
||||
...G.players
|
||||
.filter((p) => p !== player)
|
||||
.map((p) => ShipPosition[('PlayerHarbor' + p.id + '4') as keyof ShipPosition])
|
||||
);
|
||||
|
||||
remove(positions, pos => G.players.map(p => p.ship.shipPosition).indexOf(pos) != -1);
|
||||
remove(positions, (pos) => G.players.map((p) => p.ship.shipPosition).indexOf(pos) != -1);
|
||||
|
||||
if (player.ship.containers.length > 0) {
|
||||
positions.push(ShipPosition.Island);
|
||||
|
|
@ -208,18 +259,28 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
|
||||
// Produce
|
||||
const containersLeft: ContainerColor[] = [];
|
||||
Object.keys(ContainerColor).forEach(key => {
|
||||
if (G.containersLeft.filter(f => f.color.toString() === ContainerColor[key]).length > 0)
|
||||
Object.keys(ContainerColor).forEach((key) => {
|
||||
if (G.containersLeft.filter((f) => f.color.toString() === ContainerColor[key]).length > 0)
|
||||
containersLeft.push(ContainerColor[key]);
|
||||
});
|
||||
|
||||
if ((player.produced.length === 0 && player.money >= 1 && player.actions > 0) || (player.lastMove?.name === MoveName.Produce)) {
|
||||
if (player.containersOnFactoryStore.length < player.factories.length * 2 && player.produced.length < player.factories.length) {
|
||||
if (
|
||||
(player.produced.length === 0 && player.money >= 1 && player.actions > 0) ||
|
||||
player.lastMove?.name === MoveName.Produce
|
||||
) {
|
||||
if (
|
||||
player.containersOnFactoryStore.length < player.factories.length * 2 &&
|
||||
player.produced.length < player.factories.length
|
||||
) {
|
||||
const canProduce: ContainerColor[] = [];
|
||||
player.factories.forEach(factory => {
|
||||
player.factories.forEach((factory) => {
|
||||
if (canProduce.indexOf(factory.color) === -1) {
|
||||
const totalFactories = player.factories.filter(factoryColor => factoryColor === factory).length;
|
||||
const producedContainers = player.produced.filter(producedColor => producedColor === factory.color).length;
|
||||
const totalFactories = player.factories.filter(
|
||||
(factoryColor) => factoryColor === factory
|
||||
).length;
|
||||
const producedContainers = player.produced.filter(
|
||||
(producedColor) => producedColor === factory.color
|
||||
).length;
|
||||
|
||||
if (totalFactories > producedContainers && containersLeft.indexOf(factory.color) !== -1)
|
||||
canProduce.push(factory.color);
|
||||
|
|
@ -227,8 +288,7 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
});
|
||||
|
||||
if (canProduce.length > 0) {
|
||||
if (player.lastMove?.name === MoveName.Produce)
|
||||
moves = {};
|
||||
if (player.lastMove?.name === MoveName.Produce) moves = {};
|
||||
|
||||
moves[MoveName.Produce] = canProduce;
|
||||
}
|
||||
|
|
@ -237,8 +297,7 @@ export function availableMoves(G: GameState, player: Player): AvailableMoves {
|
|||
|
||||
// Undo
|
||||
const lastLog = G.log[G.log.length - 1];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer)
|
||||
moves[MoveName.Undo] = [true];
|
||||
if (lastLog.type == 'move' && lastLog.player == G.currentPlayer) moves[MoveName.Undo] = [true];
|
||||
|
||||
return moves;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +1,150 @@
|
|||
import { ContainerColor, PointCard } from "./gamestate";
|
||||
import { ContainerColor, PointCard } from './gamestate';
|
||||
|
||||
const pointCards: PointCard[] = [
|
||||
{
|
||||
containerValues: [
|
||||
{ containerColor: ContainerColor.White, baseValue: 10, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Orange, baseValue: 5, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Tan, baseValue: 6, specialValue: 6 },
|
||||
{ containerColor: ContainerColor.Brown, baseValue: 4, specialValue: 4 },
|
||||
{ containerColor: ContainerColor.Black, baseValue: 2, specialValue: 2 }
|
||||
]
|
||||
{
|
||||
containerColor: ContainerColor.White,
|
||||
baseValue: 10,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Orange,
|
||||
baseValue: 5,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Tan,
|
||||
baseValue: 6,
|
||||
specialValue: 6,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Brown,
|
||||
baseValue: 4,
|
||||
specialValue: 4,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Black,
|
||||
baseValue: 2,
|
||||
specialValue: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
containerValues: [
|
||||
{ containerColor: ContainerColor.Brown, baseValue: 10, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Black, baseValue: 5, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.White, baseValue: 6, specialValue: 6 },
|
||||
{ containerColor: ContainerColor.Orange, baseValue: 4, specialValue: 4 },
|
||||
{ containerColor: ContainerColor.Tan, baseValue: 2, specialValue: 2 }
|
||||
]
|
||||
{
|
||||
containerColor: ContainerColor.Brown,
|
||||
baseValue: 10,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Black,
|
||||
baseValue: 5,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.White,
|
||||
baseValue: 6,
|
||||
specialValue: 6,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Orange,
|
||||
baseValue: 4,
|
||||
specialValue: 4,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Tan,
|
||||
baseValue: 2,
|
||||
specialValue: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
containerValues: [
|
||||
{ containerColor: ContainerColor.Black, baseValue: 10, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.White, baseValue: 5, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Orange, baseValue: 6, specialValue: 6 },
|
||||
{ containerColor: ContainerColor.Tan, baseValue: 4, specialValue: 4 },
|
||||
{ containerColor: ContainerColor.Brown, baseValue: 2, specialValue: 2 }
|
||||
]
|
||||
{
|
||||
containerColor: ContainerColor.Black,
|
||||
baseValue: 10,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.White,
|
||||
baseValue: 5,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Orange,
|
||||
baseValue: 6,
|
||||
specialValue: 6,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Tan,
|
||||
baseValue: 4,
|
||||
specialValue: 4,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Brown,
|
||||
baseValue: 2,
|
||||
specialValue: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
containerValues: [
|
||||
{ containerColor: ContainerColor.Orange, baseValue: 10, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Tan, baseValue: 5, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Brown, baseValue: 6, specialValue: 6 },
|
||||
{ containerColor: ContainerColor.Black, baseValue: 4, specialValue: 4 },
|
||||
{ containerColor: ContainerColor.White, baseValue: 2, specialValue: 2 }
|
||||
]
|
||||
{
|
||||
containerColor: ContainerColor.Orange,
|
||||
baseValue: 10,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Tan,
|
||||
baseValue: 5,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Brown,
|
||||
baseValue: 6,
|
||||
specialValue: 6,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Black,
|
||||
baseValue: 4,
|
||||
specialValue: 4,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.White,
|
||||
baseValue: 2,
|
||||
specialValue: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
containerValues: [
|
||||
{ containerColor: ContainerColor.Tan, baseValue: 10, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Brown, baseValue: 5, specialValue: 10 },
|
||||
{ containerColor: ContainerColor.Black, baseValue: 6, specialValue: 6 },
|
||||
{ containerColor: ContainerColor.White, baseValue: 4, specialValue: 4 },
|
||||
{ containerColor: ContainerColor.Orange, baseValue: 2, specialValue: 2 }
|
||||
]
|
||||
{
|
||||
containerColor: ContainerColor.Tan,
|
||||
baseValue: 10,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Brown,
|
||||
baseValue: 5,
|
||||
specialValue: 10,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Black,
|
||||
baseValue: 6,
|
||||
specialValue: 6,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.White,
|
||||
baseValue: 4,
|
||||
specialValue: 4,
|
||||
},
|
||||
{
|
||||
containerColor: ContainerColor.Orange,
|
||||
baseValue: 2,
|
||||
specialValue: 2,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
import { expect } from "chai";
|
||||
import { availableMoves } from "./available-moves";
|
||||
import { setup, move as execMove, ended } from './engine';
|
||||
import { ContainerColor, ShipPosition } from "./gamestate";
|
||||
import { Move } from './move';
|
||||
import { expect } from 'chai';
|
||||
import { ended, setup } from './engine';
|
||||
|
||||
describe("Engine", () => {
|
||||
it("should play full game", () => {
|
||||
const G = setup(5, { beginner: false }, "test");
|
||||
describe('Engine', () => {
|
||||
it('should play full game', () => {
|
||||
const G = setup(5, { beginner: false }, 'test');
|
||||
|
||||
// G.currentPlayer = 0;
|
||||
// G.players[0].actions = 2;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,16 @@ import { cloneDeep, groupBy, isEqual } from 'lodash';
|
|||
import seedrandom from 'seedrandom';
|
||||
import { availableMoves } from './available-moves';
|
||||
import pointCards from './cards';
|
||||
import { ContainerColor, ContainerPiece, FactoryPiece, GameOptions, GameState, Phase, Player, ShipPosition } from './gamestate';
|
||||
import {
|
||||
ContainerColor,
|
||||
ContainerPiece,
|
||||
FactoryPiece,
|
||||
GameOptions,
|
||||
GameState,
|
||||
Phase,
|
||||
Player,
|
||||
ShipPosition,
|
||||
} from './gamestate';
|
||||
import { GameEventName, LogItem } from './log';
|
||||
import { Move, MoveName, Moves } from './move';
|
||||
import { asserts, shuffle } from './utils';
|
||||
|
|
@ -22,7 +31,11 @@ export function setup(numPlayers: number, { beginner = true }: GameOptions, seed
|
|||
pointCard: cards.shift()!,
|
||||
factories: [],
|
||||
warehouses: [],
|
||||
ship: { piece: { id: 'S' + id }, containers: [], shipPosition: ShipPosition.OpenSea },
|
||||
ship: {
|
||||
piece: { id: 'S' + id },
|
||||
containers: [],
|
||||
shipPosition: ShipPosition.OpenSea,
|
||||
},
|
||||
containersOnFactoryStore: [],
|
||||
containersOnWarehouseStore: [],
|
||||
containersOnIsland: [],
|
||||
|
|
@ -38,25 +51,35 @@ export function setup(numPlayers: number, { beginner = true }: GameOptions, seed
|
|||
showBid: false,
|
||||
showAdditionalBid: false,
|
||||
finalScore: 0,
|
||||
isAI: false
|
||||
isAI: false,
|
||||
}));
|
||||
|
||||
id = 0;
|
||||
const totalContainers = players.length * 4;
|
||||
const containersLeft: ContainerPiece[] = [];
|
||||
containersLeft.push(...new Array(totalContainers).fill(0).map(_ => ({ id: 'C' + id++, color: ContainerColor.Brown })));
|
||||
containersLeft.push(...new Array(totalContainers).fill(0).map(_ => ({ id: 'C' + id++, color: ContainerColor.White })));
|
||||
containersLeft.push(...new Array(totalContainers).fill(0).map(_ => ({ id: 'C' + id++, color: ContainerColor.Black })));
|
||||
containersLeft.push(...new Array(totalContainers).fill(0).map(_ => ({ id: 'C' + id++, color: ContainerColor.Orange })));
|
||||
containersLeft.push(...new Array(totalContainers).fill(0).map(_ => ({ id: 'C' + id++, color: ContainerColor.Tan })));
|
||||
containersLeft.push(
|
||||
...new Array(totalContainers).fill(0).map((_) => ({ id: 'C' + id++, color: ContainerColor.Brown }))
|
||||
);
|
||||
containersLeft.push(
|
||||
...new Array(totalContainers).fill(0).map((_) => ({ id: 'C' + id++, color: ContainerColor.White }))
|
||||
);
|
||||
containersLeft.push(
|
||||
...new Array(totalContainers).fill(0).map((_) => ({ id: 'C' + id++, color: ContainerColor.Black }))
|
||||
);
|
||||
containersLeft.push(
|
||||
...new Array(totalContainers).fill(0).map((_) => ({ id: 'C' + id++, color: ContainerColor.Orange }))
|
||||
);
|
||||
containersLeft.push(
|
||||
...new Array(totalContainers).fill(0).map((_) => ({ id: 'C' + id++, color: ContainerColor.Tan }))
|
||||
);
|
||||
|
||||
id = 0;
|
||||
const factoriesLeft: FactoryPiece[] = [];
|
||||
factoriesLeft.push(...new Array(5).fill(0).map(_ => ({ id: 'F' + id++, color: ContainerColor.Brown })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map(_ => ({ id: 'F' + id++, color: ContainerColor.White })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map(_ => ({ id: 'F' + id++, color: ContainerColor.Black })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map(_ => ({ id: 'F' + id++, color: ContainerColor.Orange })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map(_ => ({ id: 'F' + id++, color: ContainerColor.Tan })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map((_) => ({ id: 'F' + id++, color: ContainerColor.Brown })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map((_) => ({ id: 'F' + id++, color: ContainerColor.White })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map((_) => ({ id: 'F' + id++, color: ContainerColor.Black })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map((_) => ({ id: 'F' + id++, color: ContainerColor.Orange })));
|
||||
factoriesLeft.push(...new Array(5).fill(0).map((_) => ({ id: 'F' + id++, color: ContainerColor.Tan })));
|
||||
|
||||
const warehousesLeft = new Array(players.length * 5).fill(0).map((_, i) => ({ id: 'W' + i }));
|
||||
const loansLeft = new Array(players.length * 2).fill(0).map((_, i) => ({ id: 'L' + i }));
|
||||
|
|
@ -77,18 +100,21 @@ export function setup(numPlayers: number, { beginner = true }: GameOptions, seed
|
|||
log: [],
|
||||
hiddenLog: [],
|
||||
seed,
|
||||
round: 1
|
||||
round: 1,
|
||||
} as GameState;
|
||||
|
||||
const colors = shuffle([ContainerColor.Black, ContainerColor.Orange, ContainerColor.Tan, ContainerColor.White, ContainerColor.Brown], rng() + '');
|
||||
const colors = shuffle(
|
||||
[ContainerColor.Black, ContainerColor.Orange, ContainerColor.Tan, ContainerColor.White, ContainerColor.Brown],
|
||||
rng() + ''
|
||||
);
|
||||
|
||||
G.players.forEach((player, i) => {
|
||||
const color = colors[i];
|
||||
let index = G.factoriesLeft.findIndex(f => f.color == color);
|
||||
let index = G.factoriesLeft.findIndex((f) => f.color == color);
|
||||
const factory = G.factoriesLeft.splice(index, 1)[0];
|
||||
player.factories.push(factory);
|
||||
|
||||
index = G.containersLeft.findIndex(c => c.color == color);
|
||||
index = G.containersLeft.findIndex((c) => c.color == color);
|
||||
const container = G.containersLeft.splice(index, 1)[0];
|
||||
player.containersOnFactoryStore.push({ piece: container, price: 2 });
|
||||
|
||||
|
|
@ -122,7 +148,7 @@ export function stripSecret(G: GameState, player?: number): GameState {
|
|||
};
|
||||
}
|
||||
}),
|
||||
log: G.log
|
||||
log: G.log,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -136,17 +162,23 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
|
||||
assert(G.currentPlayer === playerNumber, 'It is not your turn!');
|
||||
assert(available, 'You are not allowed to run the command ' + move.name);
|
||||
assert(available.some(x => isEqual(x, move.data)), 'Wrong argument for the command ' + move.name);
|
||||
assert(move.name != MoveName.Bid || move.extraData.price + player.bid <= player.money, 'Can\'t bid more money than you have!');
|
||||
assert(
|
||||
available.some((x) => isEqual(x, move.data)),
|
||||
'Wrong argument for the command ' + move.name
|
||||
);
|
||||
assert(
|
||||
move.name != MoveName.Bid || move.extraData.price + player.bid <= player.money,
|
||||
"Can't bid more money than you have!"
|
||||
);
|
||||
|
||||
switch (move.name) {
|
||||
case MoveName.DomesticSale: {
|
||||
asserts<Moves.MoveDomesticSale>(move);
|
||||
if (player.containersOnFactoryStore.length > 0) {
|
||||
const aux = player.containersOnFactoryStore.find(x => isEqual(x.piece, move.data))!;
|
||||
const aux = player.containersOnFactoryStore.find((x) => isEqual(x.piece, move.data))!;
|
||||
player.containersOnFactoryStore.splice(player.containersOnFactoryStore.indexOf(aux), 1);
|
||||
} else {
|
||||
const aux = player.containersOnWarehouseStore.find(x => isEqual(x.piece, move.data))!;
|
||||
const aux = player.containersOnWarehouseStore.find((x) => isEqual(x.piece, move.data))!;
|
||||
player.containersOnWarehouseStore.splice(player.containersOnWarehouseStore.indexOf(aux), 1);
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +187,14 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.money += 2;
|
||||
player.actions--;
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} sells a ${containerColorHTML(move.data.color)} container back to the supply for $2` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} sells a ${containerColorHTML(
|
||||
move.data.color
|
||||
)} container back to the supply for $2`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -167,7 +206,14 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.money -= player.factories.length * 3;
|
||||
player.actions--;
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(move.data)} factory for $${player.factories.length * 3}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(move.data)} factory for $${
|
||||
player.factories.length * 3
|
||||
}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -179,7 +225,12 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.money -= player.warehouses.length + 2;
|
||||
player.actions--;
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} buys a warehouse for $${player.warehouses.length + 2}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} buys a warehouse for $${player.warehouses.length + 2}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -187,14 +238,20 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
case MoveName.BuyFromFactory: {
|
||||
asserts<Moves.MoveBuyFromFactory>(move);
|
||||
const otherPlayer = G.players[move.data.player];
|
||||
const aux = otherPlayer.containersOnFactoryStore.find(x => isEqual(x.piece, move.data.piece))!;
|
||||
const aux = otherPlayer.containersOnFactoryStore.find((x) => isEqual(x.piece, move.data.piece))!;
|
||||
otherPlayer.containersOnFactoryStore.splice(otherPlayer.containersOnFactoryStore.indexOf(aux), 1);
|
||||
player.containersOnWarehouseStore.push({ piece: move.data.piece, price: move.extraData.price });
|
||||
player.containersOnWarehouseStore.push({
|
||||
piece: move.data.piece,
|
||||
price: move.extraData.price,
|
||||
});
|
||||
|
||||
player.money -= aux.price;
|
||||
otherPlayer.money += aux.price;
|
||||
|
||||
if (player.lastMove?.name !== MoveName.BuyFromFactory || player.lastMove?.data.player !== move.data.player) {
|
||||
if (
|
||||
player.lastMove?.name !== MoveName.BuyFromFactory ||
|
||||
player.lastMove?.data.player !== move.data.player
|
||||
) {
|
||||
player.actions -= 1;
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +259,11 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(move.data.piece.color)} container from ${playerNameHTML(otherPlayer)} for $${aux.price}, new price is $${move.extraData.price}`
|
||||
pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(
|
||||
move.data.piece.color
|
||||
)} container from ${playerNameHTML(otherPlayer)} for $${aux.price}, new price is $${
|
||||
move.extraData.price
|
||||
}`,
|
||||
});
|
||||
|
||||
break;
|
||||
|
|
@ -211,14 +272,18 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
case MoveName.BuyFromWarehouse: {
|
||||
asserts<Moves.MoveBuyFromWarehouse>(move);
|
||||
const otherPlayer = G.players[move.data.player];
|
||||
const aux = otherPlayer.containersOnWarehouseStore.find(x => isEqual(x.piece, move.data.piece))!;
|
||||
const aux = otherPlayer.containersOnWarehouseStore.find((x) => isEqual(x.piece, move.data.piece))!;
|
||||
otherPlayer.containersOnWarehouseStore.splice(otherPlayer.containersOnWarehouseStore.indexOf(aux), 1);
|
||||
player.ship.containers.push(move.data.piece);
|
||||
|
||||
player.money -= aux.price;
|
||||
otherPlayer.money += aux.price;
|
||||
|
||||
if ((player.lastMove?.name !== MoveName.BuyFromWarehouse || player.lastMove?.data.player !== move.data.player) && player.lastMove?.name !== MoveName.Sail) {
|
||||
if (
|
||||
(player.lastMove?.name !== MoveName.BuyFromWarehouse ||
|
||||
player.lastMove?.data.player !== move.data.player) &&
|
||||
player.lastMove?.name !== MoveName.Sail
|
||||
) {
|
||||
player.actions -= 1;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +291,9 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(move.data.piece.color)} container from ${playerNameHTML(otherPlayer)} for $${aux.price}`
|
||||
pretty: `${playerNameHTML(player)} buys a ${containerColorHTML(
|
||||
move.data.piece.color
|
||||
)} container from ${playerNameHTML(otherPlayer)} for $${aux.price}`,
|
||||
});
|
||||
|
||||
break;
|
||||
|
|
@ -239,9 +306,19 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.money += 10;
|
||||
|
||||
if (G.phase == Phase.Bid) {
|
||||
G.hiddenLog.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} takes a loan` });
|
||||
G.hiddenLog.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} takes a loan`,
|
||||
});
|
||||
} else {
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} takes a loan` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} takes a loan`,
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -254,9 +331,19 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.money -= 10;
|
||||
|
||||
if (G.phase == Phase.Bid) {
|
||||
G.hiddenLog.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} pays a loan` });
|
||||
G.hiddenLog.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} pays a loan`,
|
||||
});
|
||||
} else {
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} pays a loan` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} pays a loan`,
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
@ -265,7 +352,10 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
case MoveName.Produce: {
|
||||
asserts<Moves.MoveProduce>(move);
|
||||
remove(G.containersLeft, move.extraData.piece);
|
||||
player.containersOnFactoryStore.push({ piece: move.extraData.piece, price: move.extraData.price });
|
||||
player.containersOnFactoryStore.push({
|
||||
piece: move.extraData.piece,
|
||||
price: move.extraData.price,
|
||||
});
|
||||
player.produced.push(move.extraData.piece.color);
|
||||
if (player.lastMove?.name !== MoveName.Produce) {
|
||||
player.actions -= 1;
|
||||
|
|
@ -273,7 +363,14 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
playerBefore(player, G).money += 1;
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} produces a ${containerColorHTML(move.extraData.piece.color)} container, price is $${move.extraData.price}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} produces a ${containerColorHTML(
|
||||
move.extraData.piece.color
|
||||
)} container, price is $${move.extraData.price}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -290,37 +387,65 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.actions--;
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} sails to ${prettyShipPosition(G, move.data)}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} sails to ${prettyShipPosition(G, move.data)}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MoveName.ArrangeFactory: {
|
||||
asserts<Moves.MoveArrangeFactory>(move);
|
||||
const aux = player.containersOnFactoryStore.find(x => isEqual(x.piece, move.data))!;
|
||||
const aux = player.containersOnFactoryStore.find((x) => isEqual(x.piece, move.data))!;
|
||||
player.containersOnFactoryStore.splice(player.containersOnFactoryStore.indexOf(aux), 1);
|
||||
player.containersOnFactoryStore.push({ piece: move.data, price: move.extraData.price });
|
||||
player.containersOnFactoryStore.push({
|
||||
piece: move.data,
|
||||
price: move.extraData.price,
|
||||
});
|
||||
|
||||
if (player.lastMove?.name !== MoveName.Produce && player.lastMove?.name !== MoveName.ArrangeFactory) {
|
||||
player.actions--;
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} changes the price of a ${containerColorHTML(move.data.color)} factory container from $${aux.price} to $${move.extraData.price}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} changes the price of a ${containerColorHTML(
|
||||
move.data.color
|
||||
)} factory container from $${aux.price} to $${move.extraData.price}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case MoveName.ArrangeWarehouse: {
|
||||
asserts<Moves.MoveArrangeWarehouse>(move);
|
||||
const aux = player.containersOnWarehouseStore.find(x => isEqual(x.piece, move.data))!;
|
||||
const aux = player.containersOnWarehouseStore.find((x) => isEqual(x.piece, move.data))!;
|
||||
player.containersOnWarehouseStore.splice(player.containersOnWarehouseStore.indexOf(aux), 1);
|
||||
player.containersOnWarehouseStore.push({ piece: move.data, price: move.extraData.price });
|
||||
player.containersOnWarehouseStore.push({
|
||||
piece: move.data,
|
||||
price: move.extraData.price,
|
||||
});
|
||||
|
||||
if (player.lastMove?.name !== MoveName.BuyFromFactory && player.lastMove?.name !== MoveName.ArrangeWarehouse) {
|
||||
if (
|
||||
player.lastMove?.name !== MoveName.BuyFromFactory &&
|
||||
player.lastMove?.name !== MoveName.ArrangeWarehouse
|
||||
) {
|
||||
player.actions--;
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} changes the price of a ${containerColorHTML(move.data.color)} warehouse container from $${aux.price} to $${move.extraData.price}` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} changes the price of a ${containerColorHTML(
|
||||
move.data.color
|
||||
)} warehouse container from $${aux.price} to $${move.extraData.price}`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -329,31 +454,55 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
asserts<Moves.MoveBid>(move);
|
||||
|
||||
if (G.highestBidders.length === 0) {
|
||||
G.hiddenLog.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} bids $${move.extraData.price}` });
|
||||
G.hiddenLog.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} bids $${move.extraData.price}`,
|
||||
});
|
||||
player.bid = move.extraData.price;
|
||||
nextPlayer(G);
|
||||
} else {
|
||||
G.hiddenLog.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} bids additional $${move.extraData.price}` });
|
||||
G.hiddenLog.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} bids additional $${move.extraData.price}`,
|
||||
});
|
||||
player.additionalBid = move.extraData.price;
|
||||
do { nextPlayer(G); } while (G.highestBidders.indexOf(G.currentPlayer) === -1 && G.auctioningPlayer !== G.currentPlayer);
|
||||
do {
|
||||
nextPlayer(G);
|
||||
} while (G.highestBidders.indexOf(G.currentPlayer) === -1 && G.auctioningPlayer !== G.currentPlayer);
|
||||
}
|
||||
|
||||
if (G.auctioningPlayer === G.currentPlayer) {
|
||||
if (G.highestBidders.length === 0) {
|
||||
G.players.filter(p => p.id !== G.currentPlayer).forEach(p => { p.showBid = true; });
|
||||
const highestBid = Math.max(...G.players.map(p => p.bid));
|
||||
const highestBidders = G.players.filter(p => p.id != G.currentPlayer && p.bid === highestBid).map(p => p.id);
|
||||
G.players
|
||||
.filter((p) => p.id !== G.currentPlayer)
|
||||
.forEach((p) => {
|
||||
p.showBid = true;
|
||||
});
|
||||
const highestBid = Math.max(...G.players.map((p) => p.bid));
|
||||
const highestBidders = G.players
|
||||
.filter((p) => p.id != G.currentPlayer && p.bid === highestBid)
|
||||
.map((p) => p.id);
|
||||
G.highestBidders = highestBidders;
|
||||
if (highestBidders.length > 1) {
|
||||
while (highestBidders.indexOf(G.currentPlayer) === -1) { nextPlayer(G); }
|
||||
while (highestBidders.indexOf(G.currentPlayer) === -1) {
|
||||
nextPlayer(G);
|
||||
}
|
||||
} else {
|
||||
G.phase = Phase.AcceptDecline;
|
||||
}
|
||||
} else {
|
||||
const highestBid = Math.max(...G.players.map(p => p.bid + p.additionalBid));
|
||||
const highestBidders = G.players.filter(p => p.id != G.currentPlayer && p.bid + p.additionalBid === highestBid).map(p => p.id);
|
||||
const highestBid = Math.max(...G.players.map((p) => p.bid + p.additionalBid));
|
||||
const highestBidders = G.players
|
||||
.filter((p) => p.id != G.currentPlayer && p.bid + p.additionalBid === highestBid)
|
||||
.map((p) => p.id);
|
||||
G.highestBidders = highestBidders;
|
||||
G.players.forEach(p => { p.showAdditionalBid = true; });
|
||||
G.players.forEach((p) => {
|
||||
p.showAdditionalBid = true;
|
||||
});
|
||||
G.phase = Phase.AcceptDecline;
|
||||
}
|
||||
}
|
||||
|
|
@ -372,15 +521,19 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.ship.containers = [];
|
||||
otherPlayer.money -= otherPlayer.bid + otherPlayer.additionalBid;
|
||||
player.money += (otherPlayer.bid + otherPlayer.additionalBid) * 2;
|
||||
G.players.forEach(p => { p.bid = p.additionalBid = 0; });
|
||||
G.players.forEach(p => { p.showBid = p.showAdditionalBid = false; });
|
||||
G.players.forEach((p) => {
|
||||
p.bid = p.additionalBid = 0;
|
||||
});
|
||||
G.players.forEach((p) => {
|
||||
p.showBid = p.showAdditionalBid = false;
|
||||
});
|
||||
G.auctioningPlayer = undefined;
|
||||
G.highestBidders = [];
|
||||
G.phase = Phase.Move;
|
||||
|
||||
nextPlayer(G);
|
||||
if (!fake) {
|
||||
if ([...new Set(G.containersLeft.map(c => c.color))].length >= 4) {
|
||||
if ([...new Set(G.containersLeft.map((c) => c.color))].length >= 4) {
|
||||
doUpkeep(G);
|
||||
} else {
|
||||
G.phase = Phase.GameEnd;
|
||||
|
|
@ -389,7 +542,12 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
}
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} accepts ${playerNameHTML(otherPlayer)}'s bid` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} accepts ${playerNameHTML(otherPlayer)}'s bid`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -399,15 +557,19 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
player.ship.containers = [];
|
||||
const bid = G.players[G.highestBidders[0]].bid + G.players[G.highestBidders[0]].additionalBid;
|
||||
player.money -= bid;
|
||||
G.players.forEach(p => { p.bid = p.additionalBid = 0; });
|
||||
G.players.forEach(p => { p.showBid = p.showAdditionalBid = false; });
|
||||
G.players.forEach((p) => {
|
||||
p.bid = p.additionalBid = 0;
|
||||
});
|
||||
G.players.forEach((p) => {
|
||||
p.showBid = p.showAdditionalBid = false;
|
||||
});
|
||||
G.auctioningPlayer = undefined;
|
||||
G.highestBidders = [];
|
||||
G.phase = Phase.Move;
|
||||
|
||||
nextPlayer(G);
|
||||
if (!fake) {
|
||||
if ([...new Set(G.containersLeft.map(c => c.color))].length >= 4) {
|
||||
if ([...new Set(G.containersLeft.map((c) => c.color))].length >= 4) {
|
||||
doUpkeep(G);
|
||||
} else {
|
||||
G.phase = Phase.GameEnd;
|
||||
|
|
@ -416,7 +578,12 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
}
|
||||
}
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} declines all bids` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} declines all bids`,
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -424,11 +591,16 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
case MoveName.Pass: {
|
||||
asserts<Moves.MovePass>(move);
|
||||
|
||||
G.log.push({ type: 'move', player: playerNumber, move, pretty: `${playerNameHTML(player)} passes` });
|
||||
G.log.push({
|
||||
type: 'move',
|
||||
player: playerNumber,
|
||||
move,
|
||||
pretty: `${playerNameHTML(player)} passes`,
|
||||
});
|
||||
|
||||
nextPlayer(G);
|
||||
if (!fake) {
|
||||
if ([...new Set(G.containersLeft.map(c => c.color))].length >= 4) {
|
||||
if ([...new Set(G.containersLeft.map((c) => c.color))].length >= 4) {
|
||||
doUpkeep(G);
|
||||
} else {
|
||||
G.phase = Phase.GameEnd;
|
||||
|
|
@ -455,8 +627,7 @@ export function move(G: GameState, move: Move, playerNumber: number, fake?: bool
|
|||
|
||||
player.availableMoves = null;
|
||||
|
||||
if (move.name != MoveName.GetLoan && move.name != MoveName.PayLoan)
|
||||
player.lastMove = move;
|
||||
if (move.name != MoveName.GetLoan && move.name != MoveName.PayLoan) player.lastMove = move;
|
||||
|
||||
if (G.currentPlayer !== undefined)
|
||||
G.players[G.currentPlayer].availableMoves = availableMoves(G, G.players[G.currentPlayer]);
|
||||
|
|
@ -477,18 +648,31 @@ export function moveAI(G: GameState, playerNumber: number): GameState {
|
|||
moveName = MoveName.PayLoan;
|
||||
const dataArr = player.availableMoves![moveName];
|
||||
data = dataArr[Math.floor(Math.random() * dataArr.length)];
|
||||
} else if (G.phase == Phase.Move && player.actions > 0 && player.ship.containers.length > 0 && player.lastMove?.name != MoveName.BuyFromWarehouse) {
|
||||
} else if (
|
||||
G.phase == Phase.Move &&
|
||||
player.actions > 0 &&
|
||||
player.ship.containers.length > 0 &&
|
||||
player.lastMove?.name != MoveName.BuyFromWarehouse
|
||||
) {
|
||||
moveName = MoveName.Sail;
|
||||
data = player.ship.shipPosition == ShipPosition.OpenSea ? ShipPosition.Island : ShipPosition.OpenSea;
|
||||
} else {
|
||||
const moves = Object.keys(player.availableMoves!);
|
||||
|
||||
if (player.lastMove?.name == MoveName.Sail && player.ship.containers.length < 5 &&
|
||||
((player.lastMove?.data.startsWith('playerHarbor0') && G.players[0].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor1') && G.players[1].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor2') && G.players[2].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor3') && G.players[3].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor4') && G.players[4].containersOnWarehouseStore.length > 0))) {
|
||||
if (
|
||||
player.lastMove?.name == MoveName.Sail &&
|
||||
player.ship.containers.length < 5 &&
|
||||
((player.lastMove?.data.startsWith('playerHarbor0') &&
|
||||
G.players[0].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor1') &&
|
||||
G.players[1].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor2') &&
|
||||
G.players[2].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor3') &&
|
||||
G.players[3].containersOnWarehouseStore.length > 0) ||
|
||||
(player.lastMove?.data.startsWith('playerHarbor4') &&
|
||||
G.players[4].containersOnWarehouseStore.length > 0))
|
||||
) {
|
||||
moveName = MoveName.BuyFromWarehouse;
|
||||
} else {
|
||||
moveName = moves[Math.floor(Math.random() * moves.length)];
|
||||
|
|
@ -506,33 +690,24 @@ export function moveAI(G: GameState, playerNumber: number): GameState {
|
|||
moveName = null;
|
||||
} else if (moveName == MoveName.Sail) {
|
||||
if (data == ShipPosition.Island) {
|
||||
if (player.ship.containers.length == 0)
|
||||
moveName = null;
|
||||
if (player.ship.containers.length == 0) moveName = null;
|
||||
} else if (data.startsWith('playerHarbor0')) {
|
||||
if (G.players[0].containersOnWarehouseStore.length == 0)
|
||||
moveName = null;
|
||||
if (G.players[0].containersOnWarehouseStore.length == 0) moveName = null;
|
||||
} else if (data.startsWith('playerHarbor1')) {
|
||||
if (G.players[1].containersOnWarehouseStore.length == 0)
|
||||
moveName = null;
|
||||
if (G.players[1].containersOnWarehouseStore.length == 0) moveName = null;
|
||||
} else if (data.startsWith('playerHarbor2')) {
|
||||
if (G.players[2].containersOnWarehouseStore.length == 0)
|
||||
moveName = null;
|
||||
if (G.players[2].containersOnWarehouseStore.length == 0) moveName = null;
|
||||
} else if (data.startsWith('playerHarbor3')) {
|
||||
if (G.players[3].containersOnWarehouseStore.length == 0)
|
||||
moveName = null;
|
||||
if (G.players[3].containersOnWarehouseStore.length == 0) moveName = null;
|
||||
} else if (data.startsWith('playerHarbor4')) {
|
||||
if (G.players[4].containersOnWarehouseStore.length == 0)
|
||||
moveName = null;
|
||||
if (G.players[4].containersOnWarehouseStore.length == 0) moveName = null;
|
||||
} else {
|
||||
if (player.lastMove?.name == MoveName.Sail)
|
||||
moveName = null;
|
||||
if (player.lastMove?.name == MoveName.Sail) moveName = null;
|
||||
}
|
||||
} else if (moveName == MoveName.ArrangeFactory) {
|
||||
if (player.lastMove?.name != MoveName.Produce)
|
||||
moveName = null;
|
||||
if (player.lastMove?.name != MoveName.Produce) moveName = null;
|
||||
} else if (moveName == MoveName.ArrangeWarehouse) {
|
||||
if (player.lastMove?.name != MoveName.BuyFromFactory)
|
||||
moveName = null;
|
||||
if (player.lastMove?.name != MoveName.BuyFromFactory) moveName = null;
|
||||
} else if (moveName == MoveName.GetLoan) {
|
||||
moveName = null;
|
||||
} else if (moveName == MoveName.Produce) {
|
||||
|
|
@ -548,14 +723,11 @@ export function moveAI(G: GameState, playerNumber: number): GameState {
|
|||
moveName = null;
|
||||
}
|
||||
} else if (moveName == MoveName.BuyFactory) {
|
||||
if (player.factories.length == 3 || player.money < 15)
|
||||
moveName = null;
|
||||
if (player.factories.length == 3 || player.money < 15) moveName = null;
|
||||
} else if (moveName == MoveName.BuyWarehouse) {
|
||||
if (player.warehouses.length == 3 || player.money < 17)
|
||||
moveName = null;
|
||||
if (player.warehouses.length == 3 || player.money < 17) moveName = null;
|
||||
} else if (moveName == MoveName.DomesticSale) {
|
||||
if (player.money > 5)
|
||||
moveName = null;
|
||||
if (player.money > 5) moveName = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -565,32 +737,63 @@ export function moveAI(G: GameState, playerNumber: number): GameState {
|
|||
let playerMove: Move;
|
||||
switch (moveName) {
|
||||
case MoveName.BuyFromFactory:
|
||||
playerMove = { name: moveName, data, extraData: { price: Math.floor(Math.random() * 3) + 2 } };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: { price: Math.floor(Math.random() * 3) + 2 },
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.BuyFactory:
|
||||
playerMove = { name: moveName, data, extraData: G.factoriesLeft.find(p => p.color == data) };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: G.factoriesLeft.find((p) => p.color == data),
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.BuyWarehouse:
|
||||
playerMove = { name: moveName, data, extraData: G.warehousesLeft[0] };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: G.warehousesLeft[0],
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.Produce:
|
||||
playerMove = { name: moveName, data, extraData: { piece: G.containersLeft.find(p => p.color == data), price: Math.floor(Math.random() * 3) + 1 } };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: {
|
||||
piece: G.containersLeft.find((p) => p.color == data),
|
||||
price: Math.floor(Math.random() * 3) + 1,
|
||||
},
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.ArrangeFactory:
|
||||
playerMove = { name: moveName, data, extraData: { price: Math.floor(Math.random() * 3) + 1 } };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: { price: Math.floor(Math.random() * 3) + 1 },
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.ArrangeWarehouse:
|
||||
playerMove = { name: moveName, data, extraData: { price: Math.floor(Math.random() * 3) + 2 } };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: { price: Math.floor(Math.random() * 3) + 2 },
|
||||
};
|
||||
break;
|
||||
|
||||
case MoveName.Bid: {
|
||||
const bid = Math.floor(Math.random() * (player.money - player.bid));
|
||||
playerMove = { name: moveName, data, extraData: { price: bid > 10 ? Math.ceil(bid / 2) : bid } };
|
||||
playerMove = {
|
||||
name: moveName,
|
||||
data,
|
||||
extraData: { price: bid > 10 ? Math.ceil(bid / 2) : bid },
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -607,14 +810,14 @@ export function ended(G: GameState): boolean {
|
|||
}
|
||||
|
||||
function calculateEndScore(G: GameState) {
|
||||
G.players.forEach(player => {
|
||||
G.players.forEach((player) => {
|
||||
player.finalScoreBreakdown = [];
|
||||
player.finalScoreBreakdown.push('$' + player.money);
|
||||
|
||||
if (player.containersOnIsland.length > 0) {
|
||||
const hasOneOfEach = [...new Set(player.containersOnIsland.map(c => c.color))].length == 5;
|
||||
const hasOneOfEach = [...new Set(player.containersOnIsland.map((c) => c.color))].length == 5;
|
||||
|
||||
const grouped = groupBy(player.containersOnIsland, piece => piece.color);
|
||||
const grouped = groupBy(player.containersOnIsland, (piece) => piece.color);
|
||||
const most = Object.keys(grouped).reduce((a, b) => {
|
||||
if (grouped[a].length == grouped[b].length) {
|
||||
if (a == player.pointCard!.containerValues[1].containerColor) {
|
||||
|
|
@ -622,8 +825,12 @@ function calculateEndScore(G: GameState) {
|
|||
} else if (b == player.pointCard!.containerValues[1].containerColor) {
|
||||
return b;
|
||||
} else {
|
||||
const aValue = player.pointCard!.containerValues.find(cv => cv.containerColor == a)!.baseValue;
|
||||
const bValue = player.pointCard!.containerValues.find(cv => cv.containerColor == b)!.baseValue;
|
||||
const aValue = player.pointCard!.containerValues.find(
|
||||
(cv) => cv.containerColor == a
|
||||
)!.baseValue;
|
||||
const bValue = player.pointCard!.containerValues.find(
|
||||
(cv) => cv.containerColor == b
|
||||
)!.baseValue;
|
||||
return aValue > bValue ? b : a;
|
||||
}
|
||||
}
|
||||
|
|
@ -631,15 +838,26 @@ function calculateEndScore(G: GameState) {
|
|||
return grouped[a].length > grouped[b].length ? a : b;
|
||||
});
|
||||
|
||||
const points = cloneDeep(player.pointCard!.containerValues).sort((a, b) => a.containerColor.localeCompare(b.containerColor)).map(cv => {
|
||||
const points = cloneDeep(player.pointCard!.containerValues)
|
||||
.sort((a, b) => a.containerColor.localeCompare(b.containerColor))
|
||||
.map((cv) => {
|
||||
if (cv.containerColor == most) {
|
||||
player.finalScoreBreakdown!.push('$' + (hasOneOfEach ? cv.specialValue : cv.baseValue) + ' x -');
|
||||
player.finalScoreBreakdown!.push(
|
||||
'$' + (hasOneOfEach ? cv.specialValue : cv.baseValue) + ' x -'
|
||||
);
|
||||
return 0;
|
||||
} else if (grouped[cv.containerColor]) {
|
||||
player.finalScoreBreakdown!.push('$' + (hasOneOfEach ? cv.specialValue : cv.baseValue) + ' x ' + grouped[cv.containerColor].length);
|
||||
player.finalScoreBreakdown!.push(
|
||||
'$' +
|
||||
(hasOneOfEach ? cv.specialValue : cv.baseValue) +
|
||||
' x ' +
|
||||
grouped[cv.containerColor].length
|
||||
);
|
||||
return grouped[cv.containerColor].length * (hasOneOfEach ? cv.specialValue : cv.baseValue);
|
||||
} else {
|
||||
player.finalScoreBreakdown!.push('$' + (hasOneOfEach ? cv.specialValue : cv.baseValue) + ' x 0');
|
||||
player.finalScoreBreakdown!.push(
|
||||
'$' + (hasOneOfEach ? cv.specialValue : cv.baseValue) + ' x 0'
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
|
@ -663,7 +881,7 @@ function calculateEndScore(G: GameState) {
|
|||
}
|
||||
|
||||
export function scores(G: GameState): number[] {
|
||||
return G.players.map(_ => 0);
|
||||
return G.players.map((_) => 0);
|
||||
}
|
||||
|
||||
export function reconstructState(initialState: GameState, log: LogItem[]): GameState {
|
||||
|
|
@ -707,37 +925,103 @@ function doUpkeep(G: GameState) {
|
|||
interest.push('money');
|
||||
} else if (player.containersOnIsland.length > 0) {
|
||||
const container = removeRandom(player.containersOnIsland);
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(container.color)} container from ${playerNameHTML(player)}'s island` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(container.color)} container from ${playerNameHTML(
|
||||
player
|
||||
)}'s island`,
|
||||
},
|
||||
});
|
||||
} else if (player.containersOnWarehouseStore.length + player.containersOnFactoryStore.length > 0) {
|
||||
if (player.containersOnWarehouseStore.length >= 2) {
|
||||
const c1 = removeRandom(player.containersOnWarehouseStore);
|
||||
const c2 = removeRandom(player.containersOnWarehouseStore);
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(c1.color)} container and a ${containerColorHTML(c2.color)} container from ${playerNameHTML(player)}'s warehouses` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(
|
||||
c1.color
|
||||
)} container and a ${containerColorHTML(c2.color)} container from ${playerNameHTML(
|
||||
player
|
||||
)}'s warehouses`,
|
||||
},
|
||||
});
|
||||
} else if (player.containersOnWarehouseStore.length == 1) {
|
||||
const c1 = removeRandom(player.containersOnWarehouseStore);
|
||||
if (player.containersOnFactoryStore.length >= 1) {
|
||||
const c2 = removeRandom(player.containersOnFactoryStore);
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(c1.color)} container from ${playerNameHTML(player)}'s warehouses and a ${c2.color} container from ${playerNameHTML(player)}'s factory` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(
|
||||
c1.color
|
||||
)} container from ${playerNameHTML(player)}'s warehouses and a ${
|
||||
c2.color
|
||||
} container from ${playerNameHTML(player)}'s factory`,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(c1.color)} container from ${playerNameHTML(player)}'s warehouses` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(
|
||||
c1.color
|
||||
)} container from ${playerNameHTML(player)}'s warehouses`,
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const c1 = removeRandom(player.containersOnFactoryStore);
|
||||
if (player.containersOnFactoryStore.length >= 1) {
|
||||
const c2 = removeRandom(player.containersOnFactoryStore);
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(c1.color)} container and a ${containerColorHTML(c2.color)} container from ${playerNameHTML(player)}'s factory` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(
|
||||
c1.color
|
||||
)} container and a ${containerColorHTML(c2.color)} container from ${playerNameHTML(
|
||||
player
|
||||
)}'s factory`,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a ${containerColorHTML(c1.color)} container from ${playerNameHTML(player)}'s factory` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a ${containerColorHTML(
|
||||
c1.color
|
||||
)} container from ${playerNameHTML(player)}'s factory`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (player.warehouses.length > 2) {
|
||||
player.warehouses.pop();
|
||||
player.loans.pop();
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a warehouse from ${playerNameHTML(player)}` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a warehouse from ${playerNameHTML(player)}`,
|
||||
},
|
||||
});
|
||||
} else if (player.factories.length > 2) {
|
||||
player.factories.pop();
|
||||
player.loans.pop();
|
||||
G.log.push({ type: 'event', event: { name: GameEventName.Upkeep, interest: `The bank seizes a factory from ${playerNameHTML(player)}` } });
|
||||
G.log.push({
|
||||
type: 'event',
|
||||
event: {
|
||||
name: GameEventName.Upkeep,
|
||||
interest: `The bank seizes a factory from ${playerNameHTML(player)}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -750,7 +1034,7 @@ function doUpkeep(G: GameState) {
|
|||
}
|
||||
|
||||
function remove(array, value) {
|
||||
const aux = array.find(x => isEqual(x, value));
|
||||
const aux = array.find((x) => isEqual(x, value));
|
||||
return array.splice(array.indexOf(aux), 1);
|
||||
}
|
||||
|
||||
|
|
@ -782,7 +1066,9 @@ function prettyShipPosition(G: GameState, data: ShipPosition): string {
|
|||
}
|
||||
|
||||
function playerNameHTML(player) {
|
||||
return `<span style="background-color: ${playerColors[player.id]}; font-weight: bold; padding: 0 3px;">${player.name}</span>`;
|
||||
return `<span style="background-color: ${playerColors[player.id]}; font-weight: bold; padding: 0 3px;">${
|
||||
player.name
|
||||
}</span>`;
|
||||
}
|
||||
|
||||
function containerColorHTML(containerColor: ContainerColor) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export enum ContainerColor {
|
|||
Brown = 'brown',
|
||||
White = 'white',
|
||||
Black = 'darkslategray',
|
||||
Tan = 'tan'
|
||||
Tan = 'tan',
|
||||
}
|
||||
|
||||
export interface ContainerValue {
|
||||
|
|
@ -51,7 +51,7 @@ export enum ShipPosition {
|
|||
PlayerHarbor42 = 'playerHarbor42',
|
||||
PlayerHarbor43 = 'playerHarbor43',
|
||||
PlayerHarbor44 = 'playerHarbor44',
|
||||
Island = 'island'
|
||||
Island = 'island',
|
||||
}
|
||||
|
||||
export interface Ship {
|
||||
|
|
@ -90,7 +90,7 @@ export enum Phase {
|
|||
Bid = 'bid',
|
||||
AcceptDecline = 'acceptDecline',
|
||||
Setup = 'setup',
|
||||
GameEnd = 'gameEnd'
|
||||
GameEnd = 'gameEnd',
|
||||
}
|
||||
|
||||
export interface ContainerPiece {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { Move } from './move';
|
|||
export enum GameEventName {
|
||||
GameStart = 'Game Start!',
|
||||
GameEnd = 'Game End!',
|
||||
Upkeep = 'Upkeep'
|
||||
Upkeep = 'Upkeep',
|
||||
}
|
||||
|
||||
export declare namespace GameEvents {
|
||||
|
|
@ -32,13 +32,13 @@ export type LogPhase = {
|
|||
export type LogEvent = {
|
||||
type: 'event';
|
||||
event: GameEvent;
|
||||
}
|
||||
};
|
||||
|
||||
export type LogMove = {
|
||||
type: 'move';
|
||||
player: number;
|
||||
move: Move;
|
||||
pretty: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type LogItem = LogPhase | LogEvent | LogMove;
|
||||
|
|
|
|||
|
|
@ -96,13 +96,22 @@ export declare namespace Moves {
|
|||
}
|
||||
|
||||
export type Move =
|
||||
Moves.MoveBuyFromFactory | Moves.MoveBuyFromWarehouse |
|
||||
Moves.MoveBuyFactory | Moves.MoveBuyWarehouse |
|
||||
Moves.MoveGetLoan | Moves.MovePayLoan |
|
||||
Moves.MoveProduce | Moves.MoveSail |
|
||||
Moves.MoveArrangeFactory | Moves.MoveArrangeWarehouse |
|
||||
Moves.MoveBid | Moves.MoveAccept | Moves.MoveDecline |
|
||||
Moves.MovePass | Moves.MoveUndo | Moves.MoveDomesticSale;
|
||||
| Moves.MoveBuyFromFactory
|
||||
| Moves.MoveBuyFromWarehouse
|
||||
| Moves.MoveBuyFactory
|
||||
| Moves.MoveBuyWarehouse
|
||||
| Moves.MoveGetLoan
|
||||
| Moves.MovePayLoan
|
||||
| Moves.MoveProduce
|
||||
| Moves.MoveSail
|
||||
| Moves.MoveArrangeFactory
|
||||
| Moves.MoveArrangeWarehouse
|
||||
| Moves.MoveBid
|
||||
| Moves.MoveAccept
|
||||
| Moves.MoveDecline
|
||||
| Moves.MovePass
|
||||
| Moves.MoveUndo
|
||||
| Moves.MoveDomesticSale;
|
||||
|
||||
export enum MoveName {
|
||||
DomesticSale = 'domesticSale',
|
||||
|
|
@ -120,5 +129,5 @@ export enum MoveName {
|
|||
Accept = 'accept',
|
||||
Decline = 'decline',
|
||||
Pass = 'pass',
|
||||
Undo = 'undo'
|
||||
Undo = 'undo',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { expect } from "chai";
|
||||
import { expect } from 'chai';
|
||||
import { shuffle } from './utils';
|
||||
|
||||
describe("utils", () => {
|
||||
describe("shuffle", () => {
|
||||
it("should shuffle the same way based on the seed", () => {
|
||||
expect(shuffle([1, 2, 3, 4], "a")).to.have.ordered.members([4, 2, 3, 1]);
|
||||
expect(shuffle([1, 2, 3, 4], "b")).to.have.ordered.members([3, 1, 2, 4]);
|
||||
expect(shuffle([1, 2, 3, 4], "b")).to.have.ordered.members([3, 1, 2, 4]);
|
||||
expect(shuffle([1, 2, 3, 4], "a")).to.have.ordered.members([4, 2, 3, 1]);
|
||||
describe('utils', () => {
|
||||
describe('shuffle', () => {
|
||||
it('should shuffle the same way based on the seed', () => {
|
||||
expect(shuffle([1, 2, 3, 4], 'a')).to.have.ordered.members([4, 2, 3, 1]);
|
||||
expect(shuffle([1, 2, 3, 4], 'b')).to.have.ordered.members([3, 1, 2, 4]);
|
||||
expect(shuffle([1, 2, 3, 4], 'b')).to.have.ordered.members([3, 1, 2, 4]);
|
||||
expect(shuffle([1, 2, 3, 4], 'a')).to.have.ordered.members([4, 2, 3, 1]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import seedrandom from "seedrandom";
|
||||
import seedrandom from 'seedrandom';
|
||||
|
||||
/* eslint-disable */
|
||||
export function asserts<T>(move: any): asserts move is T {
|
||||
}
|
||||
export function asserts<T>(move: any): asserts move is T {}
|
||||
|
||||
/* eslint-enable */
|
||||
|
||||
|
|
@ -20,5 +19,5 @@ export function shuffle<T>(array: T[], seed: string) {
|
|||
reverse.set(n, i);
|
||||
});
|
||||
|
||||
return [...reverse.keys()].sort().map(n => array[reverse.get(n)!]);
|
||||
return [...reverse.keys()].sort().map((n) => array[reverse.get(n)!]);
|
||||
}
|
||||
|
|
@ -5,22 +5,12 @@
|
|||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"strictNullChecks": true,
|
||||
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
"sourceMap": false, /* Generates corresponding '.map' file. */
|
||||
"declaration": true /* Generates corresponding '.d.ts' file. */,
|
||||
"sourceMap": false /* Generates corresponding '.map' file. */,
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./dist", /* Redirect output structure to the directory. */
|
||||
"outDir": "./dist" /* Redirect output structure to the directory. */
|
||||
},
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
"index.ts",
|
||||
"wrapper.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"**/*.spec.ts"
|
||||
]
|
||||
"types": ["node"],
|
||||
"include": ["src/**/*.ts", "index.ts", "wrapper.ts"],
|
||||
"exclude": ["node_modules", "dist", "**/*.spec.ts"]
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import type { GameState } from './index';
|
||||
import { Move } from './src/move';
|
||||
import * as engine from './src/engine';
|
||||
import { asserts } from './src/utils';
|
||||
import type { LogMove } from './src/log';
|
||||
import { Move } from './src/move';
|
||||
import { asserts } from './src/utils';
|
||||
|
||||
export async function init(nbPlayers: number, expansions: string[], options: {}, seed?: string): Promise<GameState> {
|
||||
return engine.setup(nbPlayers, options, seed);
|
||||
|
|
@ -20,7 +20,7 @@ export async function move(G: GameState, move: Move, player: number) {
|
|||
return G;
|
||||
}
|
||||
|
||||
export { ended, scores } from './src/engine';
|
||||
export { ended, scores, stripSecret } from './src/engine';
|
||||
|
||||
export function rankings(G: GameState) {
|
||||
const sortedPlayers = G.players
|
||||
|
|
@ -30,9 +30,10 @@ export function rankings(G: GameState) {
|
|||
} else {
|
||||
return p1.money - p2.money;
|
||||
}
|
||||
}).map(pl => pl.id);
|
||||
})
|
||||
.map((pl) => pl.id);
|
||||
|
||||
return G.players.map(pl => sortedPlayers.indexOf(pl.id) + 1);
|
||||
return G.players.map((pl) => sortedPlayers.indexOf(pl.id) + 1);
|
||||
}
|
||||
|
||||
export function replay(G: GameState) {
|
||||
|
|
@ -46,7 +47,7 @@ export function replay(G: GameState) {
|
|||
G.players[i].name = oldPlayers[i].name;
|
||||
}
|
||||
|
||||
for (const move of oldG.log.filter(event => event.type === 'move')) {
|
||||
for (const move of oldG.log.filter((event) => event.type === 'move')) {
|
||||
asserts<LogMove>(move);
|
||||
|
||||
G = engine.move(G, move.move, move.player);
|
||||
|
|
@ -69,15 +70,13 @@ export function currentPlayer(G: GameState) {
|
|||
return G.currentPlayer;
|
||||
}
|
||||
|
||||
export { stripSecret } from './src/engine';
|
||||
|
||||
export function messages(G: GameState) {
|
||||
const messages = (G as any).messages || [];
|
||||
delete (G as any).messages;
|
||||
|
||||
return {
|
||||
messages,
|
||||
data: G
|
||||
data: G,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -89,8 +88,11 @@ export function logSlice(G: GameState, options?: { player?: number; start?: numb
|
|||
const stripped = engine.stripSecret(G, options?.player);
|
||||
return {
|
||||
log: stripped.log.slice(options?.start, options?.end),
|
||||
availableMoves: options?.end === undefined ?
|
||||
stripped.players.map(pl => pl.availableMoves) :
|
||||
engine.stripSecret(replay({ ...G, log: G.log.slice(0, options!.end) }), options!.player).players.map(pl => pl.availableMoves)
|
||||
availableMoves:
|
||||
options?.end === undefined
|
||||
? stripped.players.map((pl) => pl.availableMoves)
|
||||
: engine
|
||||
.stripSecret(replay({ ...G, log: G.log.slice(0, options!.end) }), options!.player)
|
||||
.players.map((pl) => pl.availableMoves),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
446
pnpm-lock.yaml
generated
446
pnpm-lock.yaml
generated
|
|
@ -15,21 +15,29 @@ devDependencies:
|
|||
typescript: 4.3.5
|
||||
|
||||
packages:
|
||||
|
||||
/@babel/code-frame/7.14.5:
|
||||
resolution: {integrity: sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-9pzDqyc6OLDaqe+zbACgFkb6fKMNG6CObKpnYXChRsvYGyEdc7CA2BaqeOM+vOtCS5ndmJicPJhKAwYRI6UfFw==,
|
||||
}
|
||||
engines: { node: '>=6.9.0' }
|
||||
dependencies:
|
||||
'@babel/highlight': 7.14.5
|
||||
dev: true
|
||||
|
||||
/@babel/helper-validator-identifier/7.14.5:
|
||||
resolution: {integrity: sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==,
|
||||
}
|
||||
engines: { node: '>=6.9.0' }
|
||||
dev: true
|
||||
|
||||
/@babel/highlight/7.14.5:
|
||||
resolution: {integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==,
|
||||
}
|
||||
engines: { node: '>=6.9.0' }
|
||||
dependencies:
|
||||
'@babel/helper-validator-identifier': 7.14.5
|
||||
|
|
@ -38,11 +46,17 @@ packages:
|
|||
dev: true
|
||||
|
||||
/@types/parse-json/4.0.0:
|
||||
resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/aggregate-error/3.1.0:
|
||||
resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
clean-stack: 2.2.0
|
||||
|
|
@ -50,55 +64,82 @@ packages:
|
|||
dev: true
|
||||
|
||||
/ansi-colors/4.1.1:
|
||||
resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dev: true
|
||||
|
||||
/ansi-escapes/4.3.2:
|
||||
resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
type-fest: 0.21.3
|
||||
dev: true
|
||||
|
||||
/ansi-regex/5.0.0:
|
||||
resolution: {integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/ansi-styles/3.2.1:
|
||||
resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==,
|
||||
}
|
||||
engines: { node: '>=4' }
|
||||
dependencies:
|
||||
color-convert: 1.9.3
|
||||
dev: true
|
||||
|
||||
/ansi-styles/4.3.0:
|
||||
resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
color-convert: 2.0.1
|
||||
dev: true
|
||||
|
||||
/astral-regex/2.0.0:
|
||||
resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/braces/3.0.2:
|
||||
resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
fill-range: 7.0.1
|
||||
dev: true
|
||||
|
||||
/callsites/3.1.0:
|
||||
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dev: true
|
||||
|
||||
/chalk/2.4.2:
|
||||
resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==,
|
||||
}
|
||||
engines: { node: '>=4' }
|
||||
dependencies:
|
||||
ansi-styles: 3.2.1
|
||||
|
|
@ -107,7 +148,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/chalk/4.1.1:
|
||||
resolution: {integrity: sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
|
|
@ -115,19 +159,28 @@ packages:
|
|||
dev: true
|
||||
|
||||
/clean-stack/2.2.0:
|
||||
resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dev: true
|
||||
|
||||
/cli-cursor/3.1.0:
|
||||
resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
restore-cursor: 3.1.0
|
||||
dev: true
|
||||
|
||||
/cli-truncate/2.1.0:
|
||||
resolution: {integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
slice-ansi: 3.0.0
|
||||
|
|
@ -135,13 +188,19 @@ packages:
|
|||
dev: true
|
||||
|
||||
/color-convert/1.9.3:
|
||||
resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==,
|
||||
}
|
||||
dependencies:
|
||||
color-name: 1.1.3
|
||||
dev: true
|
||||
|
||||
/color-convert/2.0.1:
|
||||
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==,
|
||||
}
|
||||
engines: { node: '>=7.0.0' }
|
||||
dependencies:
|
||||
color-name: 1.1.4
|
||||
|
|
@ -152,20 +211,32 @@ packages:
|
|||
dev: true
|
||||
|
||||
/color-name/1.1.4:
|
||||
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/colorette/1.2.2:
|
||||
resolution: {integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/commander/6.2.1:
|
||||
resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==,
|
||||
}
|
||||
engines: { node: '>= 6' }
|
||||
dev: true
|
||||
|
||||
/cosmiconfig/7.0.0:
|
||||
resolution: {integrity: sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
'@types/parse-json': 4.0.0
|
||||
|
|
@ -176,7 +247,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/cross-spawn/7.0.3:
|
||||
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==,
|
||||
}
|
||||
engines: { node: '>= 8' }
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
|
|
@ -185,7 +259,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/debug/4.3.1:
|
||||
resolution: {integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==,
|
||||
}
|
||||
engines: { node: '>=6.0' }
|
||||
peerDependencies:
|
||||
supports-color: '*'
|
||||
|
|
@ -201,24 +278,36 @@ packages:
|
|||
dev: true
|
||||
|
||||
/emoji-regex/8.0.0:
|
||||
resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/end-of-stream/1.4.4:
|
||||
resolution: {integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==,
|
||||
}
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
dev: true
|
||||
|
||||
/enquirer/2.3.6:
|
||||
resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==,
|
||||
}
|
||||
engines: { node: '>=8.6' }
|
||||
dependencies:
|
||||
ansi-colors: 4.1.1
|
||||
dev: true
|
||||
|
||||
/error-ex/1.3.2:
|
||||
resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==,
|
||||
}
|
||||
dependencies:
|
||||
is-arrayish: 0.2.1
|
||||
dev: true
|
||||
|
|
@ -229,7 +318,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/execa/4.1.0:
|
||||
resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
cross-spawn: 7.0.3
|
||||
|
|
@ -244,18 +336,27 @@ packages:
|
|||
dev: true
|
||||
|
||||
/fill-range/7.0.1:
|
||||
resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
to-regex-range: 5.0.1
|
||||
dev: true
|
||||
|
||||
/get-own-enumerable-property-symbols/3.0.2:
|
||||
resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/get-stream/5.2.0:
|
||||
resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
pump: 3.0.0
|
||||
|
|
@ -267,23 +368,35 @@ packages:
|
|||
dev: true
|
||||
|
||||
/has-flag/4.0.0:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/human-signals/1.1.1:
|
||||
resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==,
|
||||
}
|
||||
engines: { node: '>=8.12.0' }
|
||||
dev: true
|
||||
|
||||
/husky/5.2.0:
|
||||
resolution: {integrity: sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg==,
|
||||
}
|
||||
engines: { node: '>= 10' }
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/import-fresh/3.3.0:
|
||||
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dependencies:
|
||||
parent-module: 1.0.1
|
||||
|
|
@ -291,7 +404,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/indent-string/4.0.0:
|
||||
resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
|
|
@ -300,12 +416,18 @@ packages:
|
|||
dev: true
|
||||
|
||||
/is-fullwidth-code-point/3.0.0:
|
||||
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/is-number/7.0.0:
|
||||
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==,
|
||||
}
|
||||
engines: { node: '>=0.12.0' }
|
||||
dev: true
|
||||
|
||||
|
|
@ -320,12 +442,18 @@ packages:
|
|||
dev: true
|
||||
|
||||
/is-stream/2.0.0:
|
||||
resolution: {integrity: sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/is-unicode-supported/0.1.0:
|
||||
resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dev: true
|
||||
|
||||
|
|
@ -334,11 +462,17 @@ packages:
|
|||
dev: true
|
||||
|
||||
/js-tokens/4.0.0:
|
||||
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/json-parse-even-better-errors/2.3.1:
|
||||
resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/lines-and-columns/1.1.6:
|
||||
|
|
@ -346,7 +480,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/lint-staged/10.5.4:
|
||||
resolution: {integrity: sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-EechC3DdFic/TdOPgj/RB3FicqE6932LTHCUm0Y2fsD9KGlLB+RwJl2q1IYBIvEsKzDOgn0D4gll+YxG5RsrKg==,
|
||||
}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
chalk: 4.1.1
|
||||
|
|
@ -369,7 +506,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/listr2/3.10.0_enquirer@2.3.6:
|
||||
resolution: {integrity: sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-eP40ZHihu70sSmqFNbNy2NL1YwImmlMmPh9WO5sLmPDleurMHt3n+SwEWNu2kzKScexZnkyFtc1VI0z/TGlmpw==,
|
||||
}
|
||||
engines: { node: '>=10.0.0' }
|
||||
peerDependencies:
|
||||
enquirer: '>= 2.3.0 < 3'
|
||||
|
|
@ -385,7 +525,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/log-symbols/4.1.0:
|
||||
resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
chalk: 4.1.1
|
||||
|
|
@ -393,7 +536,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/log-update/4.0.0:
|
||||
resolution: {integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
ansi-escapes: 4.3.2
|
||||
|
|
@ -403,11 +549,17 @@ packages:
|
|||
dev: true
|
||||
|
||||
/merge-stream/2.0.0:
|
||||
resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/micromatch/4.0.4:
|
||||
resolution: {integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==,
|
||||
}
|
||||
engines: { node: '>=8.6' }
|
||||
dependencies:
|
||||
braces: 3.0.2
|
||||
|
|
@ -415,21 +567,33 @@ packages:
|
|||
dev: true
|
||||
|
||||
/mimic-fn/2.1.0:
|
||||
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dev: true
|
||||
|
||||
/ms/2.1.2:
|
||||
resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/normalize-path/3.0.0:
|
||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==,
|
||||
}
|
||||
engines: { node: '>=0.10.0' }
|
||||
dev: true
|
||||
|
||||
/npm-run-path/4.0.1:
|
||||
resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
path-key: 3.1.1
|
||||
|
|
@ -442,28 +606,40 @@ packages:
|
|||
dev: true
|
||||
|
||||
/onetime/5.1.2:
|
||||
resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dependencies:
|
||||
mimic-fn: 2.1.0
|
||||
dev: true
|
||||
|
||||
/p-map/4.0.0:
|
||||
resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
aggregate-error: 3.1.0
|
||||
dev: true
|
||||
|
||||
/parent-module/1.0.1:
|
||||
resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dependencies:
|
||||
callsites: 3.1.0
|
||||
dev: true
|
||||
|
||||
/parse-json/5.2.0:
|
||||
resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
'@babel/code-frame': 7.14.5
|
||||
|
|
@ -473,28 +649,43 @@ packages:
|
|||
dev: true
|
||||
|
||||
/path-key/3.1.1:
|
||||
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/path-type/4.0.0:
|
||||
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/picomatch/2.3.0:
|
||||
resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==,
|
||||
}
|
||||
engines: { node: '>=8.6' }
|
||||
dev: true
|
||||
|
||||
/please-upgrade-node/3.2.0:
|
||||
resolution: {integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==,
|
||||
}
|
||||
dependencies:
|
||||
semver-compare: 1.0.0
|
||||
dev: true
|
||||
|
||||
/prettier-plugin-organize-imports/1.1.1_prettier@2.3.2+typescript@4.3.5:
|
||||
resolution: {integrity: sha512-rFA1lnek1FYkMGthm4xBKME41qUKItTovuo24bCGZu/Vu1n3gW71UPLAkIdwewwkZCe29gRVweSOPXvAdckFuw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-rFA1lnek1FYkMGthm4xBKME41qUKItTovuo24bCGZu/Vu1n3gW71UPLAkIdwewwkZCe29gRVweSOPXvAdckFuw==,
|
||||
}
|
||||
peerDependencies:
|
||||
prettier: '>=1.10'
|
||||
typescript: '>=2.8.2'
|
||||
|
|
@ -504,25 +695,37 @@ packages:
|
|||
dev: true
|
||||
|
||||
/prettier/2.3.2:
|
||||
resolution: {integrity: sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==,
|
||||
}
|
||||
engines: { node: '>=10.13.0' }
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/pump/3.0.0:
|
||||
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==,
|
||||
}
|
||||
dependencies:
|
||||
end-of-stream: 1.4.4
|
||||
once: 1.4.0
|
||||
dev: true
|
||||
|
||||
/resolve-from/4.0.0:
|
||||
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==,
|
||||
}
|
||||
engines: { node: '>=4' }
|
||||
dev: true
|
||||
|
||||
/restore-cursor/3.1.0:
|
||||
resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
onetime: 5.1.2
|
||||
|
|
@ -530,7 +733,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/rxjs/6.6.7:
|
||||
resolution: {integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==,
|
||||
}
|
||||
engines: { npm: '>=2.0.0' }
|
||||
dependencies:
|
||||
tslib: 1.14.1
|
||||
|
|
@ -541,23 +747,35 @@ packages:
|
|||
dev: true
|
||||
|
||||
/shebang-command/2.0.0:
|
||||
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
shebang-regex: 3.0.0
|
||||
dev: true
|
||||
|
||||
/shebang-regex/3.0.0:
|
||||
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dev: true
|
||||
|
||||
/signal-exit/3.0.3:
|
||||
resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/slice-ansi/3.0.0:
|
||||
resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
|
|
@ -566,7 +784,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/slice-ansi/4.0.0:
|
||||
resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
|
|
@ -575,12 +796,18 @@ packages:
|
|||
dev: true
|
||||
|
||||
/string-argv/0.3.1:
|
||||
resolution: {integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==,
|
||||
}
|
||||
engines: { node: '>=0.6.19' }
|
||||
dev: true
|
||||
|
||||
/string-width/4.2.2:
|
||||
resolution: {integrity: sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
emoji-regex: 8.0.0
|
||||
|
|
@ -589,7 +816,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/stringify-object/3.3.0:
|
||||
resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==,
|
||||
}
|
||||
engines: { node: '>=4' }
|
||||
dependencies:
|
||||
get-own-enumerable-property-symbols: 3.0.2
|
||||
|
|
@ -598,26 +828,38 @@ packages:
|
|||
dev: true
|
||||
|
||||
/strip-ansi/6.0.0:
|
||||
resolution: {integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
ansi-regex: 5.0.0
|
||||
dev: true
|
||||
|
||||
/strip-final-newline/2.0.0:
|
||||
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==,
|
||||
}
|
||||
engines: { node: '>=6' }
|
||||
dev: true
|
||||
|
||||
/supports-color/5.5.0:
|
||||
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==,
|
||||
}
|
||||
engines: { node: '>=4' }
|
||||
dependencies:
|
||||
has-flag: 3.0.0
|
||||
dev: true
|
||||
|
||||
/supports-color/7.2.0:
|
||||
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
has-flag: 4.0.0
|
||||
|
|
@ -628,29 +870,44 @@ packages:
|
|||
dev: true
|
||||
|
||||
/to-regex-range/5.0.1:
|
||||
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==,
|
||||
}
|
||||
engines: { node: '>=8.0' }
|
||||
dependencies:
|
||||
is-number: 7.0.0
|
||||
dev: true
|
||||
|
||||
/tslib/1.14.1:
|
||||
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/type-fest/0.21.3:
|
||||
resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dev: true
|
||||
|
||||
/typescript/4.3.5:
|
||||
resolution: {integrity: sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==,
|
||||
}
|
||||
engines: { node: '>=4.2.0' }
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/which/2.0.2:
|
||||
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==,
|
||||
}
|
||||
engines: { node: '>= 8' }
|
||||
hasBin: true
|
||||
dependencies:
|
||||
|
|
@ -658,7 +915,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/wrap-ansi/6.2.0:
|
||||
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==,
|
||||
}
|
||||
engines: { node: '>=8' }
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
|
|
@ -667,7 +927,10 @@ packages:
|
|||
dev: true
|
||||
|
||||
/wrap-ansi/7.0.0:
|
||||
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==,
|
||||
}
|
||||
engines: { node: '>=10' }
|
||||
dependencies:
|
||||
ansi-styles: 4.3.0
|
||||
|
|
@ -680,6 +943,9 @@ packages:
|
|||
dev: true
|
||||
|
||||
/yaml/1.10.2:
|
||||
resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==}
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==,
|
||||
}
|
||||
engines: { node: '>= 6' }
|
||||
dev: true
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
packages:
|
||||
- "viewer"
|
||||
- "engine"
|
||||
- 'viewer'
|
||||
- 'engine'
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
module.exports = {
|
||||
extends: ["eslint:recommended", "plugin:vue/recommended"],
|
||||
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",
|
||||
'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",
|
||||
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"],
|
||||
'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",
|
||||
parser: '@typescript-eslint/parser',
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
<template>
|
||||
|
||||
</template>
|
||||
<template></template>
|
||||
<script lang="ts">
|
||||
import {Vue, Component, Prop, Watch} from "vue-property-decorator";
|
||||
|
||||
|
|
@ -8,5 +6,4 @@ import {Vue, Component, Prop, Watch} from "vue-property-decorator";
|
|||
export default class $0 extends Vue {
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,35 @@
|
|||
# container-viewer
|
||||
|
||||
## Project setup
|
||||
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
|
||||
```
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Run your unit tests
|
||||
|
||||
```
|
||||
yarn test:unit
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
presets: ['@vue/cli-plugin-babel/preset'],
|
||||
};
|
||||
|
|
|
|||
4776
viewer/pnpm-lock.yaml
generated
4776
viewer/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,15 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico">-->
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
<strong
|
||||
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript
|
||||
enabled. Please enable it to continue.</strong
|
||||
>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ export default class Calculator extends Vue {
|
|||
this.value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.calculator {
|
||||
|
|
@ -60,7 +59,7 @@ export default class Calculator extends Vue {
|
|||
}
|
||||
|
||||
.visor {
|
||||
font-family: "system-ui";
|
||||
font-family: 'system-ui';
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -153,7 +153,6 @@ export default class DropZone extends Vue {
|
|||
return this.ui.helpOn && this.canDrop;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
g.placeholder {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@
|
|||
{{ getStatusMessage() }}
|
||||
</div>
|
||||
<audio id="piece-drop" preload="none">
|
||||
<source src="../audio/piece-drop.mp3" type="audio/mpeg">
|
||||
<source src="../audio/piece-drop.mp3" type="audio/mpeg" />
|
||||
</audio>
|
||||
<audio id="notification" preload="none">
|
||||
<source src="../audio/notification.mp3" type="audio/mpeg">
|
||||
<source src="../audio/notification.ogg" type="audio/ogg">
|
||||
<source src="../audio/notification.mp3" type="audio/mpeg" />
|
||||
<source src="../audio/notification.ogg" type="audio/ogg" />
|
||||
</audio>
|
||||
<svg id="scene" viewBox="0 0 1250 650" height="650">
|
||||
<rect width="100%" height="100%" x="0" y="0" fill="lightblue" />
|
||||
|
|
@ -21,27 +21,60 @@
|
|||
<SoundButton transform="translate(1200, 15)" :isOn="soundOn" @click="toggleSound()" />
|
||||
<HelpButton transform="translate(1200, 55)" :isOn="ui.helpOn" @click="toggleHelp()" />
|
||||
|
||||
<DropZone transform="translate(5, 5)" :width="600" :height="90" :enabled="true" :accepts="'container'" :data="{ type: 'supply' }" />
|
||||
<DropZone
|
||||
transform="translate(5, 5)"
|
||||
:width="600"
|
||||
:height="90"
|
||||
:enabled="true"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'supply' }"
|
||||
/>
|
||||
|
||||
<template v-if="G">
|
||||
<template v-for="(p, i) in G.players">
|
||||
<PlayerBoard :key="'B' + i"
|
||||
<PlayerBoard
|
||||
:key="'B' + i"
|
||||
:player="p"
|
||||
:color="playerColors[i]"
|
||||
:transform="`translate(${250 * i}, 100)`"
|
||||
:owner="i"
|
||||
:isCurrentPlayer="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]" />
|
||||
@pieceDrop="onPieceDrop"
|
||||
/>
|
||||
<rect
|
||||
:key="'I' + i"
|
||||
width="390"
|
||||
height="41"
|
||||
x="860"
|
||||
:y="430 + i * 44"
|
||||
fill="none"
|
||||
stroke-width="3"
|
||||
:stroke="playerColors[i]"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<DropZone :transform="`translate(280, 425)`" :width="400" :height="225" :enabled="true" :accepts="'ship'" :data="{ type: 'openSea' }" />
|
||||
<DropZone :transform="`translate(770, 425)`" :width="480" :height="225" :enabled="true" :accepts="'ship'" :data="{ type: 'islandHarbor' }" />
|
||||
<DropZone
|
||||
:transform="`translate(280, 425)`"
|
||||
:width="400"
|
||||
:height="225"
|
||||
:enabled="true"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'openSea' }"
|
||||
/>
|
||||
<DropZone
|
||||
:transform="`translate(770, 425)`"
|
||||
:width="480"
|
||||
:height="225"
|
||||
:enabled="true"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'islandHarbor' }"
|
||||
/>
|
||||
|
||||
<template v-for="ship in ships">
|
||||
<Ship :key="ship.id"
|
||||
<Ship
|
||||
:key="ship.id"
|
||||
:pieceId="ship.id"
|
||||
:targetState="{ x: ship.x, y: ship.y, rotate: ship.rotate }"
|
||||
:canDrag="canDragShip(ship)"
|
||||
|
|
@ -49,43 +82,63 @@
|
|||
:owner="ship.owner"
|
||||
:ownerName="G.players[ship.owner].name"
|
||||
:position="ship.position"
|
||||
:color="ship.color" />
|
||||
:color="ship.color"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-for="container in containers">
|
||||
<Container :key="container.id"
|
||||
<Container
|
||||
:key="container.id"
|
||||
:pieceId="container.id"
|
||||
:targetState="{ x: container.x, y: container.y, rotate: container.rotate }"
|
||||
:targetState="{
|
||||
x: container.x,
|
||||
y: container.y,
|
||||
rotate: container.rotate,
|
||||
}"
|
||||
:canDrag="canDragContainer(container)"
|
||||
:color="container.color"
|
||||
:owner="container.owner"
|
||||
:state="container.state" />
|
||||
:state="container.state"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-for="factory in factories">
|
||||
<Factory :key="factory.id"
|
||||
<Factory
|
||||
:key="factory.id"
|
||||
:pieceId="factory.id"
|
||||
:targetState="{ x: factory.x, y: factory.y }"
|
||||
:color="factory.color"
|
||||
:canDrag="canDragFactory(factory)" />
|
||||
:canDrag="canDragFactory(factory)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-for="warehouse in warehouses">
|
||||
<Warehouse :key="warehouse.id"
|
||||
<Warehouse
|
||||
:key="warehouse.id"
|
||||
:pieceId="warehouse.id"
|
||||
:targetState="{ x: warehouse.x, y: warehouse.y }"
|
||||
:canDrag="canDragWarehouse(warehouse)" />
|
||||
:canDrag="canDragWarehouse(warehouse)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<DropZone :transform="`translate(1045, 5)`" :width="50" :height="90" :enabled="true" :accepts="'loan'" :data="{ type: 'payLoan' }" />
|
||||
<DropZone
|
||||
:transform="`translate(1045, 5)`"
|
||||
:width="50"
|
||||
:height="90"
|
||||
:enabled="true"
|
||||
:accepts="'loan'"
|
||||
:data="{ type: 'payLoan' }"
|
||||
/>
|
||||
|
||||
<template v-for="loanCard in loanCards">
|
||||
<LoanCard :key="loanCard.id"
|
||||
<LoanCard
|
||||
:key="loanCard.id"
|
||||
:targetState="{ x: loanCard.x, y: loanCard.y }"
|
||||
:owner="loanCard.owner"
|
||||
:player="player"
|
||||
:canDrag="canDragLoan(loanCard)"
|
||||
@fastClick="loan($event)" />
|
||||
@fastClick="loan($event)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-if="G">
|
||||
|
|
@ -97,53 +150,282 @@
|
|||
<Calculator v-if="G.phase == 'bid'" transform="translate(140, 430)" @bid="bid($event)" />
|
||||
<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 ' + getName(bidder)" @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'" :enabled="canDecline()" @click="decline()" />
|
||||
<Button
|
||||
:transform="`translate(140, ${450 + 40 * G.highestBidders.length})`"
|
||||
:width="130"
|
||||
:text="'Decline'"
|
||||
:enabled="canDecline()"
|
||||
@click="decline()"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-if="G && gameEnded(G)">
|
||||
<Button :transform="`translate(140, 580)`" :width="130" :text="'Final Score'" @click="endScoreVisible = true" />
|
||||
<Button
|
||||
:transform="`translate(140, 580)`"
|
||||
:width="130"
|
||||
:text="'Final Score'"
|
||||
@click="endScoreVisible = true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template v-if="ui.helpOn">
|
||||
<template v-if="ui.dragged == null">
|
||||
<rect v-if="canBuyFactory('orange')" x="8" y="8" width="114" height="24" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canBuyFactory('brown')" x="128" y="8" width="114" height="24" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canBuyFactory('white')" x="248" y="8" width="114" height="24" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canBuyFactory('darkslategray')" x="368" y="8" width="114" height="24" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canBuyFactory('tan')" x="488" y="8" width="114" height="24" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canBuyFactory('orange')"
|
||||
x="8"
|
||||
y="8"
|
||||
width="114"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canBuyFactory('brown')"
|
||||
x="128"
|
||||
y="8"
|
||||
width="114"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canBuyFactory('white')"
|
||||
x="248"
|
||||
y="8"
|
||||
width="114"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canBuyFactory('darkslategray')"
|
||||
x="368"
|
||||
y="8"
|
||||
width="114"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canBuyFactory('tan')"
|
||||
x="488"
|
||||
y="8"
|
||||
width="114"
|
||||
height="24"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canBuyWarehouse()" x="615" y="10" width="424" height="72" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canBuyWarehouse()"
|
||||
x="615"
|
||||
y="10"
|
||||
width="424"
|
||||
height="72"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canProduce('orange')" x="6" y="36" width="116" height="54" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canProduce('brown')" x="126" y="36" width="116" height="54" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canProduce('white')" x="246" y="36" width="116" height="54" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canProduce('darkslategray')" x="366" y="36" width="116" height="54" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canProduce('tan')" x="486" y="36" width="116" height="54" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canProduce('orange')"
|
||||
x="6"
|
||||
y="36"
|
||||
width="116"
|
||||
height="54"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canProduce('brown')"
|
||||
x="126"
|
||||
y="36"
|
||||
width="116"
|
||||
height="54"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canProduce('white')"
|
||||
x="246"
|
||||
y="36"
|
||||
width="116"
|
||||
height="54"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canProduce('darkslategray')"
|
||||
x="366"
|
||||
y="36"
|
||||
width="116"
|
||||
height="54"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canProduce('tan')"
|
||||
x="486"
|
||||
y="36"
|
||||
width="116"
|
||||
height="54"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canGetLoan()" x="1045" y="5" width="50" height="90" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canGetLoan()"
|
||||
x="1045"
|
||||
y="5"
|
||||
width="50"
|
||||
height="90"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canPass()" x="1104" y="4" width="82" height="28" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canPass()"
|
||||
x="1104"
|
||||
y="4"
|
||||
width="82"
|
||||
height="28"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canUndo()" x="1104" y="35" width="82" height="28" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canUndo()"
|
||||
x="1104"
|
||||
y="35"
|
||||
width="82"
|
||||
height="28"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canPayLoan()" :x="200 + player * 250" y="123" width="47" height="77" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canPayLoan()"
|
||||
:x="200 + player * 250"
|
||||
y="123"
|
||||
width="47"
|
||||
height="77"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<g v-if="canSail()">
|
||||
<rect v-if="!ships[player].rotate" :x="ships[player].x - 5" :y="ships[player].y - 5" width="40" height="90" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-else :x="ships[player].x - 30" :y="ships[player].y + 20" width="90" height="40" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="!ships[player].rotate"
|
||||
:x="ships[player].x - 5"
|
||||
:y="ships[player].y - 5"
|
||||
width="40"
|
||||
height="90"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-else
|
||||
:x="ships[player].x - 30"
|
||||
:y="ships[player].y + 20"
|
||||
width="90"
|
||||
height="40"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
</g>
|
||||
|
||||
<rect v-if="canArrangeFactory()" :x="6 + player * 250" y="158" width="188" height="44" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canArrangeFactory()"
|
||||
:x="6 + player * 250"
|
||||
y="158"
|
||||
width="188"
|
||||
height="44"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<rect v-if="canArrangeWarehouse()" :x="6 + player * 250" y="248" width="236" height="44" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canArrangeWarehouse()"
|
||||
:x="6 + player * 250"
|
||||
y="248"
|
||||
width="236"
|
||||
height="44"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
|
||||
<template v-if="G">
|
||||
<template v-for="(p, i) in G.players">
|
||||
<rect v-if="canBuyFromPlayerFactory(p)" :key="'PHF' + i" :x="6 + i * 250" y="158" width="188" height="44" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect v-if="canBuyFromPlayerWarehouse(p)" :key="'PHW' + i" :x="6 + i * 250" y="248" width="236" height="44" fill="none" stroke="blue" stroke-width="2px" rx="2px" />
|
||||
<rect
|
||||
v-if="canBuyFromPlayerFactory(p)"
|
||||
:key="'PHF' + i"
|
||||
:x="6 + i * 250"
|
||||
y="158"
|
||||
width="188"
|
||||
height="44"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
<rect
|
||||
v-if="canBuyFromPlayerWarehouse(p)"
|
||||
:key="'PHW' + i"
|
||||
:x="6 + i * 250"
|
||||
y="248"
|
||||
width="236"
|
||||
height="44"
|
||||
fill="none"
|
||||
stroke="blue"
|
||||
stroke-width="2px"
|
||||
rx="2px"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
|
|
@ -170,15 +452,34 @@
|
|||
<table class="final-score-table">
|
||||
<tr>
|
||||
<th>Player</th>
|
||||
<th v-for="player in G.players" :key="'FS' + player.id">{{ player.name }}</th>
|
||||
<th v-for="player in G.players" :key="'FS' + player.id">
|
||||
{{ player.name }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr v-for="(cat, i) in ['Money', 'Brown', 'Dark Green', 'Orange', 'Tan', 'White', 'Containers in Warehouse', 'Containers in Ship', 'Loans']" :key="'FC_' + cat">
|
||||
<tr
|
||||
v-for="(cat, i) in [
|
||||
'Money',
|
||||
'Brown',
|
||||
'Dark Green',
|
||||
'Orange',
|
||||
'Tan',
|
||||
'White',
|
||||
'Containers in Warehouse',
|
||||
'Containers in Ship',
|
||||
'Loans',
|
||||
]"
|
||||
:key="'FC_' + cat"
|
||||
>
|
||||
<td>{{ cat }}</td>
|
||||
<td v-for="player in G.players" :key="'FS' + player.id + i">{{ player.finalScoreBreakdown ? player.finalScoreBreakdown[i] : '0' }}</td>
|
||||
<td v-for="player in G.players" :key="'FS' + player.id + i">
|
||||
{{ player.finalScoreBreakdown ? player.finalScoreBreakdown[i] : '0' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Final Score</td>
|
||||
<td v-for="player in G.players" :key="'FS' + player.id + 'money'">{{ player.money > 0 ? '$' + player.money : '-$' + Math.abs(player.money) }}</td>
|
||||
<td v-for="player in G.players" :key="'FS' + player.id + 'money'">
|
||||
{{ player.money > 0 ? '$' + player.money : '-$' + Math.abs(player.money) }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
@ -877,7 +1178,6 @@ export default class Game extends Vue {
|
|||
return logReversed;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.game {
|
||||
|
|
@ -915,7 +1215,7 @@ html {
|
|||
}
|
||||
|
||||
text {
|
||||
font-family: "Arial";
|
||||
font-family: 'Arial';
|
||||
pointer-events: none;
|
||||
dominant-baseline: central;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<template>
|
||||
<g class="player-board">
|
||||
<rect width="250" height="20" x="0" y="0" :fill="color" />
|
||||
<text x="5" y="10" font-weight="600" fill="black" :text-decoration="isCurrentPlayer ? 'underline' : ''">{{ getPlayerName() }}</text>
|
||||
<text x="5" y="10" font-weight="600" fill="black" :text-decoration="isCurrentPlayer ? 'underline' : ''">{{
|
||||
getPlayerName()
|
||||
}}</text>
|
||||
|
||||
<rect width="250" height="180" x="0" y="20" fill="gray" />
|
||||
|
||||
|
|
@ -9,12 +11,43 @@
|
|||
<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(20, 200)`" :width="42" :height="80" :accepts="'ship'" :data="{ type: 'playerHarbor' + owner + '1', owner: owner }" />
|
||||
<DropZone :transform="`translate(82, 200)`" :width="42" :height="80" :accepts="'ship'" :data="{ type: 'playerHarbor' + owner + '2', owner: owner }" />
|
||||
<DropZone :transform="`translate(144, 200)`" :width="42" :height="80" :accepts="'ship'" :data="{ type: 'playerHarbor' + owner + '3', owner: owner }" />
|
||||
<DropZone :transform="`translate(206, 200)`" :width="43" :height="80" :accepts="'ship'" :data="{ type: 'playerHarbor' + owner + '4', owner: owner }" />
|
||||
<DropZone
|
||||
:transform="`translate(20, 200)`"
|
||||
:width="42"
|
||||
:height="80"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'playerHarbor' + owner + '1', owner: owner }"
|
||||
/>
|
||||
<DropZone
|
||||
:transform="`translate(82, 200)`"
|
||||
:width="42"
|
||||
:height="80"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'playerHarbor' + owner + '2', owner: owner }"
|
||||
/>
|
||||
<DropZone
|
||||
:transform="`translate(144, 200)`"
|
||||
:width="42"
|
||||
:height="80"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'playerHarbor' + owner + '3', owner: owner }"
|
||||
/>
|
||||
<DropZone
|
||||
:transform="`translate(206, 200)`"
|
||||
:width="43"
|
||||
:height="80"
|
||||
:accepts="'ship'"
|
||||
:data="{ type: 'playerHarbor' + owner + '4', owner: owner }"
|
||||
/>
|
||||
|
||||
<DropZone :transform="`translate(200, 23)`" :width="47" :height="77" :enabled="isCurrentPlayer" :accepts="'loan'" :data="{ type: 'getLoan' }" />
|
||||
<DropZone
|
||||
:transform="`translate(200, 23)`"
|
||||
:width="47"
|
||||
:height="77"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'loan'"
|
||||
:data="{ type: 'getLoan' }"
|
||||
/>
|
||||
|
||||
<circle r="14" cx="28" cy="40" fill="none" stroke="lightgray" />
|
||||
<text text-anchor="middle" x="28" y="40" fill="lightgray">-</text>
|
||||
|
|
@ -24,48 +57,135 @@
|
|||
<text text-anchor="middle" x="124" y="40" fill="lightgray">9</text>
|
||||
<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(13, 25)`" :width="174" :height="30" :enabled="isCurrentPlayer" :accepts="'factory'" :data="{ type: 'factory' }" />
|
||||
<DropZone
|
||||
:transform="`translate(13, 25)`"
|
||||
:width="174"
|
||||
:height="30"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'factory'"
|
||||
:data="{ type: 'factory' }"
|
||||
/>
|
||||
|
||||
<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(8, 60)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 1 }" />
|
||||
<DropZone
|
||||
:transform="`translate(8, 60)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'factoryStore', price: 1 }"
|
||||
/>
|
||||
<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(56, 60)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 2 }" />
|
||||
<DropZone
|
||||
:transform="`translate(56, 60)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'factoryStore', price: 2 }"
|
||||
/>
|
||||
<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(104, 60)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 3 }" />
|
||||
<DropZone
|
||||
:transform="`translate(104, 60)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'factoryStore', price: 3 }"
|
||||
/>
|
||||
<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(152, 60)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'factoryStore', price: 4 }" />
|
||||
<DropZone
|
||||
:transform="`translate(152, 60)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'factoryStore', price: 4 }"
|
||||
/>
|
||||
|
||||
<g transform="translate(8, 105)"><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray" /></g>
|
||||
<g transform="translate(8, 105)"
|
||||
><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray"
|
||||
/></g>
|
||||
<text text-anchor="middle" x="28" y="128" fill="lightgray">-</text>
|
||||
<g transform="translate(56, 105)"><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray" /></g>
|
||||
<g transform="translate(56, 105)"
|
||||
><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray"
|
||||
/></g>
|
||||
<text text-anchor="middle" x="76" y="128" fill="lightgray">4</text>
|
||||
<g transform="translate(104, 105)"><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray" /></g>
|
||||
<g transform="translate(104, 105)"
|
||||
><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray"
|
||||
/></g>
|
||||
<text text-anchor="middle" x="124" y="128" fill="lightgray">5</text>
|
||||
<g transform="translate(152, 105)"><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray" /></g>
|
||||
<g transform="translate(152, 105)"
|
||||
><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray"
|
||||
/></g>
|
||||
<text text-anchor="middle" x="172" y="128" fill="lightgray">6</text>
|
||||
<g transform="translate(200, 105)"><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray" /></g>
|
||||
<g transform="translate(200, 105)"
|
||||
><path d="M20 0 L40 13 L40 40 L0 40 L0 13Z" fill="none" stroke="lightgray"
|
||||
/></g>
|
||||
<text text-anchor="middle" x="220" y="128" fill="lightgray">7</text>
|
||||
<DropZone :transform="`translate(7, 104)`" :width="234" :height="42" :enabled="isCurrentPlayer" :accepts="'warehouse'" :data="{ type: 'warehouse' }" />
|
||||
<DropZone
|
||||
:transform="`translate(7, 104)`"
|
||||
:width="234"
|
||||
:height="42"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'warehouse'"
|
||||
:data="{ type: 'warehouse' }"
|
||||
/>
|
||||
|
||||
<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(8, 150)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 2 }" />
|
||||
<DropZone
|
||||
:transform="`translate(8, 150)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'warehouseStore', price: 2 }"
|
||||
/>
|
||||
<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(56, 150)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 3 }" />
|
||||
<DropZone
|
||||
:transform="`translate(56, 150)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'warehouseStore', price: 3 }"
|
||||
/>
|
||||
<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(104, 150)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 4 }" />
|
||||
<DropZone
|
||||
:transform="`translate(104, 150)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'warehouseStore', price: 4 }"
|
||||
/>
|
||||
<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(152, 150)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 5 }" />
|
||||
<DropZone
|
||||
:transform="`translate(152, 150)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'warehouseStore', price: 5 }"
|
||||
/>
|
||||
<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>
|
||||
<DropZone :transform="`translate(200, 150)`" :width="40" :height="40" :enabled="isCurrentPlayer" :accepts="'container'" :data="{ type: 'warehouseStore', price: 6 }" />
|
||||
<DropZone
|
||||
:transform="`translate(200, 150)`"
|
||||
:width="40"
|
||||
:height="40"
|
||||
:enabled="isCurrentPlayer"
|
||||
:accepts="'container'"
|
||||
:data="{ type: 'warehouseStore', price: 6 }"
|
||||
/>
|
||||
</g>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
|
|
@ -119,5 +239,4 @@ export default class PlayerBoard extends Vue {
|
|||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -5,15 +5,50 @@
|
|||
</g>
|
||||
<g v-else>
|
||||
<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" />
|
||||
<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
|
||||
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
|
||||
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
|
||||
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
|
||||
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>
|
||||
|
|
@ -29,7 +64,6 @@ export default class PointCard extends Vue {
|
|||
|
||||
turned = false;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-card {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
<template>
|
||||
<g :id="elId" :class="['piece', { dragging, canDrag }]" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 10, 5)`">
|
||||
<g
|
||||
:id="elId"
|
||||
:class="['piece', { dragging, canDrag }]"
|
||||
:transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 10, 5)`"
|
||||
>
|
||||
<filter id="my-filter">
|
||||
<feComponentTransfer>
|
||||
<feFuncR type="linear" slope="0.5" />
|
||||
|
|
@ -33,5 +37,4 @@ export default class Container extends Mixins(Piece) {
|
|||
@Prop()
|
||||
state?: ContainerState;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -103,5 +103,4 @@ export default class Draggable extends Vue {
|
|||
};
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -19,5 +19,4 @@ export default class Factory extends Mixins(Piece) {
|
|||
@Prop()
|
||||
color?: string;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ export default class LoanCard extends Mixins(Piece) {
|
|||
@Prop()
|
||||
player?: number;
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.loan {
|
||||
|
|
|
|||
|
|
@ -124,5 +124,4 @@ export default class Piece extends Draggable {
|
|||
return this.dragging ? 'dragged' : (this.transitioning || this.moving ? 'moving' : undefined);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
<template>
|
||||
<g :id="elId" :class="['piece', { dragging, canDrag }]" :transform="`translate(${currentX}, ${currentY}) rotate(${rotate}, 15, 40)`">
|
||||
<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"
|
||||
<Container
|
||||
:key="container.id"
|
||||
:pieceId="container.id"
|
||||
:targetState="{ x: 5, y: 15 + 12 * i, rotate: 0 }"
|
||||
:canDrag="false"
|
||||
:color="container.color" />
|
||||
:color="container.color"
|
||||
/>
|
||||
</template>
|
||||
<DropZone :width="30" :height="80" :enabled="player == owner" :accepts="'container'" :data="{ type: 'ship' }" />
|
||||
<title>{{ ownerName }}'s Ship</title>
|
||||
|
|
@ -48,5 +54,4 @@ export default class Ship extends Mixins(Piece) {
|
|||
@Prop()
|
||||
position!: ShipPosition;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -16,5 +16,4 @@ import Piece from './Piece.vue';
|
|||
})
|
||||
export default class Warehouse extends Mixins(Piece) {
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -4,27 +4,31 @@ import Vue from 'vue';
|
|||
import Game from './components/Game.vue';
|
||||
|
||||
function launch(selector: string) {
|
||||
let params: { state: null | GameState; player?: number; emitter: EventEmitter } = { state: null, emitter: new EventEmitter() };
|
||||
let params: {
|
||||
state: null | GameState;
|
||||
player?: number;
|
||||
emitter: EventEmitter;
|
||||
} = { state: null, emitter: new EventEmitter() };
|
||||
|
||||
const app = new Vue({
|
||||
render: (h) => h(Game, { props: params }, [])
|
||||
render: (h) => h(Game, { props: params }, []),
|
||||
}).$mount(selector);
|
||||
|
||||
const item: EventEmitter = new EventEmitter();
|
||||
|
||||
params.emitter.on('move', (move: Move) => item.emit('move', move));
|
||||
|
||||
item.addListener('state', data => {
|
||||
item.addListener('state', (data) => {
|
||||
params.state = data;
|
||||
app.$forceUpdate();
|
||||
app.$nextTick().then(() => item.emit('ready'));
|
||||
});
|
||||
item.addListener('state:updated', () => item.emit('fetchState'));
|
||||
item.addListener('player', data => {
|
||||
item.addListener('player', (data) => {
|
||||
params.player = data.index;
|
||||
app.$forceUpdate();
|
||||
});
|
||||
item.addListener('gamelog', _ => item.emit('fetchState'));
|
||||
item.addListener('gamelog', (_) => item.emit('fetchState'));
|
||||
|
||||
return item;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ function launchSelfContained(selector = '#app') {
|
|||
const playerIndex = 1;
|
||||
|
||||
for (const player of gameState.players) {
|
||||
if (player.id != playerIndex)
|
||||
player.isAI = true;
|
||||
if (player.id != playerIndex) player.isAI = true;
|
||||
}
|
||||
|
||||
emitter.on('move', async (move: Move) => {
|
||||
|
|
@ -29,8 +28,11 @@ function launchSelfContained(selector = '#app') {
|
|||
emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, playerIndex) : gameState));
|
||||
|
||||
let delay = 800;
|
||||
while (gameState.players.some(pl => pl.isAI && pl.availableMoves)) {
|
||||
gameState = moveAI(gameState, gameState.players.findIndex(pl => pl.isAI && pl.availableMoves));
|
||||
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, playerIndex) : gameState);
|
||||
setTimeout(() => emitter.emit('state', newState), delay);
|
||||
delay += 800;
|
||||
|
|
@ -39,14 +41,19 @@ function launchSelfContained(selector = '#app') {
|
|||
console.log('available moves', gameState.players[playerIndex].availableMoves);
|
||||
});
|
||||
|
||||
emitter.on('fetchSate', () => emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, playerIndex) : gameState)));
|
||||
emitter.on('fetchSate', () =>
|
||||
emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, playerIndex) : gameState))
|
||||
);
|
||||
|
||||
emitter.emit('player', { index: playerIndex });
|
||||
emitter.emit('state', cloneDeep(strip ? stripSecret(gameState, playerIndex) : gameState));
|
||||
|
||||
let delay = 800;
|
||||
while (gameState.players.some(pl => pl.isAI && pl.availableMoves)) {
|
||||
gameState = moveAI(gameState, gameState.players.findIndex(pl => pl.isAI && pl.availableMoves));
|
||||
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, playerIndex) : gameState);
|
||||
setTimeout(() => emitter.emit('state', newState), delay);
|
||||
delay += 800;
|
||||
|
|
|
|||
2
viewer/src/shims-tsx.d.ts
vendored
2
viewer/src/shims-tsx.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
import Vue, { VNode } from 'vue'
|
||||
import Vue, { VNode } from 'vue';
|
||||
|
||||
declare global {
|
||||
namespace JSX {
|
||||
|
|
|
|||
4
viewer/src/shims-vue.d.ts
vendored
4
viewer/src/shims-vue.d.ts
vendored
|
|
@ -1,4 +1,4 @@
|
|||
declare module '*.vue' {
|
||||
import Vue from 'vue'
|
||||
export default Vue
|
||||
import Vue from 'vue';
|
||||
export default Vue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export enum PieceType {
|
|||
Factory = 'factory',
|
||||
Container = 'container',
|
||||
Ship = 'ship',
|
||||
Loan = 'loan'
|
||||
Loan = 'loan',
|
||||
}
|
||||
|
||||
export enum DropZoneType {
|
||||
|
|
@ -56,7 +56,7 @@ export enum DropZoneType {
|
|||
IslandHarbor = 'islandHarbor',
|
||||
GetLoan = 'getLoan',
|
||||
PayLoan = 'payLoan',
|
||||
Supply = 'supply'
|
||||
Supply = 'supply',
|
||||
}
|
||||
|
||||
export enum ContainerState {
|
||||
|
|
@ -64,5 +64,5 @@ export enum ContainerState {
|
|||
OnFactoryStore = 'onFactoryStore',
|
||||
OnWarehouseStore = 'onWarehouseStore',
|
||||
OnShip = 'onShip',
|
||||
OnIsland = 'onIsland'
|
||||
OnIsland = 'onIsland',
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
import { expect } from 'chai'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import HelloWorld from '@/components/HelloWorld.vue'
|
||||
import HelloWorld from '@/components/HelloWorld.vue';
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import { expect } from 'chai';
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('renders props.msg when passed', () => {
|
||||
const msg = 'new message'
|
||||
const msg = 'new message';
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
propsData: { msg }
|
||||
})
|
||||
expect(wrapper.text()).to.include(msg)
|
||||
})
|
||||
})
|
||||
propsData: { msg },
|
||||
});
|
||||
expect(wrapper.text()).to.include(msg);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue