commit beba6d82cf712bca5f762ba2b950d5059ab6a565
parent 6518cd3a23b642c7de7edd51686e4680f57009d6
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 11 Jun 2023 19:37:26 -0700
cleanup
Diffstat:
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/pkg/web/handlers/interceptors/chess.go b/pkg/web/handlers/interceptors/chess.go
@@ -24,6 +24,17 @@ import (
"time"
)
+type ChessMove struct {
+ IDStr1 string
+ IDStr2 string
+ CheckW bool
+ CheckB bool
+ Move chess.Move
+ Turn chess.Color
+}
+
+var ChessPubSub = pubsub.NewPubSub[ChessMove]()
+
type ChessPlayer struct {
ID database.UserID
Username database.Username
@@ -146,8 +157,6 @@ func (g *ChessGame) renderBoardHTML1(position *chess.Position, isFlipped bool, i
background-size: cover;
background-image: url(data:image/png;base64,{{ .ImgB64 }});
}
-.newBoard td {
-}
.newBoard .img {
position: absolute;
width: 12.5%;
@@ -553,20 +562,8 @@ func (g *ChessGame) MoveStr(m string) {
}
}
idStr1 := g.PiecesCache[mov.S1()]
- //idStr2 := g.PiecesCache[mov.S2()]
delete(g.PiecesCache, mov.S1())
delete(g.PiecesCache, mov.S2())
g.PiecesCache[mov.S2()] = idStr1
_ = g.Game.MoveStr(m)
}
-
-type ChessMove struct {
- IDStr1 string
- IDStr2 string
- CheckW bool
- CheckB bool
- Move chess.Move
- Turn chess.Color
-}
-
-var ChessPubSub = pubsub.NewPubSub[ChessMove]()