func (c *Canvas) moveSelectedTiles() {
	tilePositions := c.selectionTilePositions()
	if len(tilePositions) == 0 {
		return
	}
	tilePositionsM := make(map[tile.ID]tile.Position, len(tilePositions))
	for _, tp := range tilePositions {
		tilePositionsM[tp.Tile.ID] = tp
	}
	if !c.board.CanMoveTiles(tilePositionsM) {
		return
	}
	if err := c.board.MoveTiles(tilePositionsM); err != nil {
		c.log.Error("moving tiles to presumably valid locations: " + err.Error())
		return
	}
	if c.gameStatus == game.Finished {
		return
	}
	m := message.Message{
		Type: message.MoveGameTile,
		Game: &game.Info{
			Board: board.New(nil, tilePositions),
		},
	}
	c.Socket.Send(m)
}
// moveSelectedTiles determines what tiles to move from the selection, changes the local board, and sends the update to the server.
moveSelectedTiles determines what tiles to move from the selection, changes the local board, and sends the update to the server.
// moveSelectedTiles determines what tiles to move from the selection changes the local board and sends the update to the server .
func (c *Canvas) moveSelectedTiles() {
	tilePositions := c.selectionTilePositions()
	if len(tilePositions) == 0 {
		return
	}
	tilePositionsM := make(map[tile.ID]tile.Position, len(tilePositions))
	for _, tp := range tilePositions {
		tilePositionsM[tp.Tile.ID] = tp
	}
	if !c.board.CanMoveTiles(tilePositionsM) {
		return
	}
	if err := c.board.MoveTiles(tilePositionsM); err != nil {
		c.log.Error("moving tiles to presumably valid locations: " + err.Error())
		return
	}
	if c.gameStatus == game.Finished {
		return
	}
	m := message.Message{
		Type: message.MoveGameTile,
		Game: &game.Info{
			Board: board.New(nil, tilePositions),
		},
	}
	c.Socket.Send(m)
}
func ( c * Canvas ) moveSelectedTiles ( ) { tilePositions := c . selectionTilePositions ( ) if len ( tilePositions ) == 0 { return } tilePositionsM := make ( map [ tile . ID ] tile . Position , len ( tilePositions ) ) for _ , tp := range tilePositions { tilePositionsM [ tp . Tile . ID ] = tp } if ! c . board . CanMoveTiles ( tilePositionsM ) { return } if err := c . board . MoveTiles ( tilePositionsM ) ; err != nil { c . log . Error ( " " + err . Error ( ) ) return } if c . gameStatus == game . Finished { return } m := message . Message { Type : message . MoveGameTile , Game : & game . Info { Board : board . New ( nil , tilePositions ) , } , } c . Socket . Send ( m ) }
moveSelectedTiles determines what tiles to move from the selection, changes the local board, and sends the update to the server.
moveSelectedTiles determines what tiles to move from the selection changes the local board and sends the update to the server .