Skip to content

Commit

Permalink
Add snubsquare-cells board
Browse files Browse the repository at this point in the history
  • Loading branch information
Perlkonig committed Sep 18, 2024
1 parent 6e819a0 commit 56e5f40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 11 additions & 6 deletions src/components/Board.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down Expand Up @@ -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")
Expand All @@ -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 {
Expand All @@ -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") {
Expand Down Expand Up @@ -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")
) {
Expand All @@ -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";
Expand Down Expand Up @@ -494,7 +499,7 @@
</label>
</div>
{/if}
{#if $state.board.style === "snubsquare" || $state.board.style === "onyx"}
{#if $state.board.style.startsWith("snubsquare") || $state.board.style === "onyx"}
<div class="control">
<button
class="button apButton"
Expand Down

0 comments on commit 56e5f40

Please sign in to comment.