refactoring
This commit is contained in:
parent
5acc573fc0
commit
e09ec0ce0f
@ -12,7 +12,6 @@ func (b *Board) GetNonBlockedRowAndColumn(fromSquare types.Coordinate) []types.C
|
||||
nonBlocked = append(nonBlocked, b.getNonBlockedConsecutive(squaresRight, fromSquare)...)
|
||||
nonBlocked = append(nonBlocked, b.getNonBlockedConsecutive(squaresAbove, fromSquare)...)
|
||||
nonBlocked = append(nonBlocked, b.getNonBlockedConsecutive(squaresBelow, fromSquare)...)
|
||||
|
||||
return nonBlocked
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,10 @@ func (game *Game) prepare() {
|
||||
func (game *Game) Handle() {
|
||||
defer game.killGame()
|
||||
|
||||
game.prepare()
|
||||
game.prepare()
|
||||
|
||||
var receivedMove types.Move
|
||||
var err error
|
||||
var err error
|
||||
|
||||
for {
|
||||
switch game.gameState {
|
||||
|
@ -18,7 +18,7 @@ func Test_Rook_GetNonBlockedSquares(t *testing.T) {
|
||||
assert.Len(t, squares, 14)
|
||||
})
|
||||
|
||||
t.Run("free row and column", func(t *testing.T) {
|
||||
t.Run("blocked row and column", func(t *testing.T) {
|
||||
board := newBoard()
|
||||
rook := Rook{Color: types.Black}
|
||||
rookCoordinate := types.Coordinate{Col: 5, Row: 5}
|
||||
|
2
main.go
2
main.go
@ -75,7 +75,7 @@ func hostPrivateGame(c *gin.Context) {
|
||||
u := usher.GetUsher()
|
||||
|
||||
mut.Lock()
|
||||
defer mut.Unlock()
|
||||
defer mut.Unlock()
|
||||
lobby := u.CreateNewPrivateLobby(player)
|
||||
u.AddPlayerToLobbyAndStartGameIfFull(player, lobby)
|
||||
|
||||
|
@ -12,7 +12,7 @@ func NewPassphrase() Passphrase {
|
||||
var phrase string
|
||||
var retries int
|
||||
var word string
|
||||
var words int = 2
|
||||
var words = 2
|
||||
//TODO make sure passphrases are unique
|
||||
for words > 0 {
|
||||
retries = 20
|
||||
|
Loading…
Reference in New Issue
Block a user