ianfab / fairyground

playground for Fairy-Stockfish in the browser
https://fairyground.vercel.app/
GNU General Public License v3.0
21 stars 5 forks source link

Implement piece drops #16

Closed gbtami closed 2 years ago

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
fairyground ✅ Ready (Inspect) Visit Preview Sep 30, 2022 at 8:55AM (UTC)
ianfab commented 2 years ago

Thanks a lot! I had a quick look at the preview and it looks like it is working really nicely. Will check it in more detail later.

gbtami commented 2 years ago

It is possible that not all css addition needed. I just copied it from pychess.

ianfab commented 2 years ago

I only found one minor issue, which is that in "house" variants with initial hand pieces (like shouse or gorogoroplus) it assumes that only the initial hand pieces can be dropped. Since ffish doesn't know whether a variant has capturesToHand = true I am not sure how to handle this though. Adding all pockets for variants like pocketknight or S-Chess also wouldn't be ideal. If you have an idea how to improve this you are welcome to still add it, otherwise I am also fine with merging it as is.

gbtami commented 2 years ago

I suggest to expose Variant.capturesToHand (and maybe some more variant rules like promotionPieceTypes potentially affecting any GUI) via ffish.js/pyffish, similar to how you already added Variant.twoBoards to pyffish. Until this info is not available we can use this workaround only.