Special SVG for berolina pawns
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 14 Apr 2021 17:33:59 +0000 (19:33 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 14 Apr 2021 17:33:59 +0000 (19:33 +0200)
client/public/images/pieces/Antiking/bp.svg [new symlink]
client/public/images/pieces/Antiking/wp.svg [new symlink]
client/public/images/pieces/Berolina/SOURCE [new file with mode: 0644]
client/public/images/pieces/Berolina/bp.svg [new file with mode: 0644]
client/public/images/pieces/Berolina/wp.svg [new file with mode: 0644]
client/src/variants/Antiking1.js
client/src/variants/Berolina.js
client/src/variants/Diamond.js

diff --git a/client/public/images/pieces/Antiking/bp.svg b/client/public/images/pieces/Antiking/bp.svg
new file mode 120000 (symlink)
index 0000000..d73b1f5
--- /dev/null
@@ -0,0 +1 @@
+../Berolina/bp.svg
\ No newline at end of file
diff --git a/client/public/images/pieces/Antiking/wp.svg b/client/public/images/pieces/Antiking/wp.svg
new file mode 120000 (symlink)
index 0000000..4ba4e2b
--- /dev/null
@@ -0,0 +1 @@
+../Berolina/wp.svg
\ No newline at end of file
diff --git a/client/public/images/pieces/Berolina/SOURCE b/client/public/images/pieces/Berolina/SOURCE
new file mode 100644 (file)
index 0000000..5067a58
--- /dev/null
@@ -0,0 +1 @@
+https://greenchess.net/info.php?item=downloads
diff --git a/client/public/images/pieces/Berolina/bp.svg b/client/public/images/pieces/Berolina/bp.svg
new file mode 100644 (file)
index 0000000..7b2df98
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       Berolina-gyalog (fekete)
+       Készült: a pawn-b.svg felhasználásával
+       Felhasználási feltételek: Nevezd meg! - Így add tovább! (Creative Commons)
+       Uray M. János
+       2014-2018
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 45 45">
+       <g stroke="#000" stroke-width="2.0" stroke-linecap="round">
+               <path d="M 22.5,11 L 22.5,8"/>
+       </g>
+       <g fill="#000" stroke="#000" stroke-width="1.5" stroke-linejoin="miter">
+               <path d="M 22.5,11.41
+                       A 4,4,0 1,0 16.83,16.09
+                       C 15.88,17.27 15.35,18.71 15.35,20.3 C 15.35,22.53 16.38,24.52 18,25.83
+                       C 15.41,27.09 11,31.58 11,39.5
+                       L 34,39.5
+                       C 34,31.58 29.59,27.09 27,25.83
+                       C 28.62,24.52 29.65,22.53 29.65,20.3 C 29.65,18.71 29.12,17.27 28.17,16.09
+                       A 4,4,0 1,0 22.5,11.41
+               "/>
+       </g>
+</svg>
diff --git a/client/public/images/pieces/Berolina/wp.svg b/client/public/images/pieces/Berolina/wp.svg
new file mode 100644 (file)
index 0000000..e25862f
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--
+       Berolina-gyalog (fehér)
+       Készült: a pawn-w.svg felhasználásával
+       Felhasználási feltételek: Nevezd meg! - Így add tovább! (Creative Commons)
+       Uray M. János
+       2014-2018
+-->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 45 45">
+       <g stroke="#000" stroke-width="2.0" stroke-linecap="round">
+               <path d="M 22.5,11 L 22.5,8"/>
+       </g>
+       <g fill="#FFF" stroke="#000" stroke-width="1.5" stroke-linejoin="miter">
+               <path d="M 22.5,11.41
+                       A 4,4,0 1,0 16.83,16.09
+                       C 15.88,17.27 15.35,18.71 15.35,20.3 C 15.35,22.53 16.38,24.52 18,25.83
+                       C 15.41,27.09 11,31.58 11,39.5
+                       L 34,39.5
+                       C 34,31.58 29.59,27.09 27,25.83
+                       C 28.62,24.52 29.65,22.53 29.65,20.3 C 29.65,18.71 29.12,17.27 28.17,16.09
+                       A 4,4,0 1,0 22.5,11.41
+               "/>
+       </g>
+</svg>
index 781984f..7876da6 100644 (file)
@@ -30,7 +30,7 @@ export class Antiking1Rules extends BerolinaRules {
   }
 
   getPpath(b) {
-    return b[1] == "a" ? "Antiking/" + b : b;
+    return (['a', 'p'].includes(b[1]) ? "Antiking/" : "") + b;
   }
 
   static IsGoodPosition(position) {
index 15a567c..9b071d3 100644 (file)
@@ -2,6 +2,10 @@ import { ChessRules } from "@/base_rules";
 
 export class BerolinaRules extends ChessRules {
 
+  getPpath(b) {
+    return (b[1] == 'p' ? "Berolina/" : "") + b;
+  }
+
   // En-passant after 2-sq jump
   getEpSquare(moveOrSquare) {
     if (!moveOrSquare) return undefined;
index 658b7ad..aedd15d 100644 (file)
@@ -12,6 +12,10 @@ export class DiamondRules extends ChessRules {
     return false;
   }
 
+  getPpath(b) {
+    return (b[1] == 'p' ? "Berolina/" : "") + b;
+  }
+
   static GenRandInitFen(options) {
     if (options.randomness == 0)
       return "krbp4/rqnp4/nbpp4/pppp4/4PPPP/4PPBN/4PNQR/4PBRK w 0";