commit da06f25ff4648871ad16237486ce540f9cd2f8fc parent aab609f71ebc40cfd9650d5afa612e2ac1d7cf69 Author: n0tr1v <n0tr1v@protonmail.com> Date: Sat, 7 Jan 2023 06:44:11 -0800 remove unused code Diffstat:
| M | pkg/web/handlers/api/v1/battleship.go | | | 25 | ------------------------- |
1 file changed, 0 insertions(+), 25 deletions(-)
diff --git a/pkg/web/handlers/api/v1/battleship.go b/pkg/web/handlers/api/v1/battleship.go @@ -55,31 +55,6 @@ func newPlayer(player database.User) *BSPlayer { return p } -func (p BSPlayer) DrawForm(enemy *BSPlayer, yourTurn, gameEnded bool) string { - out := `<form method="post" style="margin-left: 10px;" action="/api/v1/chat/top-bar/battleship" target="iframe1">` - for i := 0; i < 10; i++ { - row := rune('A' + i) - for j := 0; j < 10; j++ { - if _, ok := p.shots[i*10+j]; ok { - if enemy.card.hasShipAt(i*10 + j) { - out += `<button style="height: 15px; width: 10px; background-color: red;" name="message" value="" disabled></button>` - } else { - out += `<button style="height: 15px; width: 10px; background-color: yellow;" name="message" value="" disabled></button>` - } - } else { - if yourTurn && !gameEnded { - out += `<button style="height: 15px; width: 10px;" name="message" value="/pm ` + enemy.username + " /bs " + string(row) + strconv.Itoa(j) + `"></button>` - } else { - out += `<button style="height: 15px; width: 10px;" name="message" value="/pm ` + enemy.username + " /bs " + string(row) + strconv.Itoa(j) + `" disabled></button>` - } - } - } - out += `<br />` - } - out += `</form>` - return out -} - type Direction int const (