From 56e5f402ff5a0965c9fe08c7a9527d10b3d80fb4 Mon Sep 17 00:00:00 2001 From: Aaron Dalton Date: Wed, 18 Sep 2024 16:32:21 -0600 Subject: [PATCH] Add snubsquare-cells board --- CHANGELOG.md | 1 + package-lock.json | 12 ++++++------ package.json | 2 +- src/components/Board.svelte | 17 +++++++++++------ 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0608401..f5a2428 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Added support for the new `onyx` board. +- Added support for the new `snubsquare-cells` board. ## [1.4.1] - 2024-09-10 diff --git a/package-lock.json b/package-lock.json index 7110365..a0876b4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { "name": "abstractplay-designer", - "version": "1.4.1", + "version": "1.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "abstractplay-designer", - "version": "1.4.1", + "version": "1.4.2", "dependencies": { - "@abstractplay/renderer": "^1.0.0-ci-10927249259.0", + "@abstractplay/renderer": "^1.0.0-ci-10931014075.0", "nanoid": "^4.0.2", "peerjs": "^1.4.7", "rfdc": "^1.3.0" @@ -29,9 +29,9 @@ } }, "node_modules/@abstractplay/renderer": { - "version": "1.0.0-ci-10927249259.0", - "resolved": "https://npm.pkg.github.com/download/@abstractplay/renderer/1.0.0-ci-10927249259.0/07d06745f81cc61193e969339b4769413c8189a7", - "integrity": "sha512-ebK/b5izD/KvtdFLWYk8tVgzLad4VVriGtXkc7A07YglbJako5MD56bAUKQ4f8RnqONLK9+ocCSvn5L9thph1g==", + "version": "1.0.0-ci-10931014075.0", + "resolved": "https://npm.pkg.github.com/download/@abstractplay/renderer/1.0.0-ci-10931014075.0/5fdf04c441748a709694108a8f71a967b4e291e3", + "integrity": "sha512-8X84di4qr+9HKP44ELFj9ZnV1mNgR+OwhvLDaqTFjTJ3smh+wNWBIFG/MSdZB/khohx//1eAygRt18pGlowR3A==", "license": "MIT", "dependencies": { "@svgdotjs/svg.js": "3.2.0", diff --git a/package.json b/package.json index 1e53890..4774761 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "vite": "^4.4.5" }, "dependencies": { - "@abstractplay/renderer": "^1.0.0-ci-10927249259.0", + "@abstractplay/renderer": "^1.0.0-ci-10931014075.0", "nanoid": "^4.0.2", "peerjs": "^1.4.7", "rfdc": "^1.3.0" diff --git a/src/components/Board.svelte b/src/components/Board.svelte index 4fc6a79..51d83dc 100644 --- a/src/components/Board.svelte +++ b/src/components/Board.svelte @@ -26,6 +26,10 @@ "onyx", "A snubsquare board where you can also place at the midpoints of squares.", ], + [ + "snubsquare-cells", + "A snubsquare board where you place in the spaces instead of on the vertices. The width and height refer to the number of regular vertices.", + ], [ "squares-diamonds", "A square board where the vertices are also spaces. In the designer, pieces cannot be placed anywhere. You can only use flood fill.", @@ -116,7 +120,7 @@ $state.board.style.startsWith("hex-odd") || $state.board.style.startsWith("hex-even") || $state.board.style.startsWith("hex-slanted") || - $state.board.style === "snubsquare" || + $state.board.style.startsWith("snubsquare") || $state.board.style === "onyx" || $state.board.style === "conhex-cells" || $state.board.style.startsWith("cairo") @@ -127,7 +131,8 @@ $state.board.style.startsWith("hex-odd") || $state.board.style.startsWith("hex-even") || $state.board.style.startsWith("hex-slanted") || - $state.board.style.startsWith("cairo") + $state.board.style.startsWith("cairo") || + $state.board.style === "snubsquare-cells" ) { canBlock = true; } else { @@ -136,7 +141,7 @@ if ($state.board.style === "cairo-collinear") { canInvertOrientation = true; } - if ($state.board.style === "snubsquare") { + if ($state.board.style.startsWith("snubsquare")) { $state.board.snubStart = "S"; } if ($state.board.style === "onyx") { @@ -194,7 +199,7 @@ $state.board.style.startsWith("hex-odd") || $state.board.style.startsWith("hex-even") || $state.board.style.startsWith("hex-slanted") || - $state.board.style === "snubsquare" || + $state.board.style.startsWith("snubsquare") || $state.board.style === "onyx" || $state.board.style.startsWith("cairo") ) { @@ -204,7 +209,7 @@ height: 8, blocked: canBlock ? $state.board.blocked : undefined, }; - if ($state.board.style === "snubsquare") { + if ($state.board.style.startsWith("snubsquare")) { $state.board.snubStart = "S"; } else if ($state.board.style === "onyx") { $state.board.snubStart = "T"; @@ -494,7 +499,7 @@ {/if} - {#if $state.board.style === "snubsquare" || $state.board.style === "onyx"} + {#if $state.board.style.startsWith("snubsquare") || $state.board.style === "onyx"}