From 677221603c6cee0c44b81e07951b34391b996468 Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Tue, 9 Aug 2022 21:10:51 +0000 Subject: [PATCH] Don't use component library for game boards... --- frontend/package-lock.json | 12 ++++ frontend/package.json | 3 +- .../src/lib/components/o-x/OXBoard.svelte | 54 +++++++++++++++ .../components/{ => o-x}/OXNoneIcon.svelte | 4 +- .../lib/components/{ => o-x}/OXOIcon.svelte | 3 +- .../lib/components/{ => o-x}/OXXIcon.svelte | 3 +- frontend/src/routes/index.svelte | 4 ++ frontend/src/routes/o-x.svelte | 69 +++++++++---------- 8 files changed, 109 insertions(+), 43 deletions(-) create mode 100644 frontend/src/lib/components/o-x/OXBoard.svelte rename frontend/src/lib/components/{ => o-x}/OXNoneIcon.svelte (56%) rename frontend/src/lib/components/{ => o-x}/OXOIcon.svelte (72%) rename frontend/src/lib/components/{ => o-x}/OXXIcon.svelte (72%) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0b86c28..383940e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -8,6 +8,7 @@ "name": "frontend", "version": "0.0.1", "dependencies": { + "@game-algorithms/connect-four-rust": "^0.0.1", "@game-algorithms/o-x-rust": "^0.1.0" }, "devDependencies": { @@ -80,6 +81,12 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@game-algorithms/connect-four-rust": { + "version": "0.0.1", + "resolved": "https://git.koval.net/api/packages/cyclane/npm/%40game-algorithms%2Fconnect-four-rust/-/0.0.1/connect-four-rust-0.0.1.tgz", + "integrity": "sha512-XFVCupzmxi6lL9jfrETenwQwo7JDvGby8PB2jOfRuRpmGBZwgx9GQvc9euw+LwlGCXUhN8zYqKIdoU7IDfd6ng==", + "license": "GNU GPLv3" + }, "node_modules/@game-algorithms/o-x-rust": { "version": "0.1.0", "resolved": "https://git.koval.net/api/packages/cyclane/npm/%40game-algorithms%2Fo-x-rust/-/0.1.0/o-x-rust-0.1.0.tgz", @@ -2927,6 +2934,11 @@ "strip-json-comments": "^3.1.1" } }, + "@game-algorithms/connect-four-rust": { + "version": "0.0.1", + "resolved": "https://git.koval.net/api/packages/cyclane/npm/%40game-algorithms%2Fconnect-four-rust/-/0.0.1/connect-four-rust-0.0.1.tgz", + "integrity": "sha512-XFVCupzmxi6lL9jfrETenwQwo7JDvGby8PB2jOfRuRpmGBZwgx9GQvc9euw+LwlGCXUhN8zYqKIdoU7IDfd6ng==" + }, "@game-algorithms/o-x-rust": { "version": "0.1.0", "resolved": "https://git.koval.net/api/packages/cyclane/npm/%40game-algorithms%2Fo-x-rust/-/0.1.0/o-x-rust-0.1.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index bc214ed..08201df 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -32,6 +32,7 @@ }, "type": "module", "dependencies": { - "@game-algorithms/o-x-rust": "^0.1.0" + "@game-algorithms/o-x-rust": "^0.1.0", + "@game-algorithms/connect-four-rust": "^0.0.1" } } diff --git a/frontend/src/lib/components/o-x/OXBoard.svelte b/frontend/src/lib/components/o-x/OXBoard.svelte new file mode 100644 index 0000000..24c8efd --- /dev/null +++ b/frontend/src/lib/components/o-x/OXBoard.svelte @@ -0,0 +1,54 @@ + + +
+ {#each board as b, idx} + + {/each} +
+ + diff --git a/frontend/src/lib/components/OXNoneIcon.svelte b/frontend/src/lib/components/o-x/OXNoneIcon.svelte similarity index 56% rename from frontend/src/lib/components/OXNoneIcon.svelte rename to frontend/src/lib/components/o-x/OXNoneIcon.svelte index 9d23294..e5630ab 100644 --- a/frontend/src/lib/components/OXNoneIcon.svelte +++ b/frontend/src/lib/components/o-x/OXNoneIcon.svelte @@ -2,7 +2,7 @@ diff --git a/frontend/src/lib/components/OXOIcon.svelte b/frontend/src/lib/components/o-x/OXOIcon.svelte similarity index 72% rename from frontend/src/lib/components/OXOIcon.svelte rename to frontend/src/lib/components/o-x/OXOIcon.svelte index 413b8c9..159fba1 100644 --- a/frontend/src/lib/components/OXOIcon.svelte +++ b/frontend/src/lib/components/o-x/OXOIcon.svelte @@ -2,8 +2,7 @@