-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 34.1 KB
/
.eslintcache
1
[{"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\Board.js":"1","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\App.js":"2","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\BoardTiles.js":"3","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\ChoosePiece.js":"4","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Components\\Tile.js":"5","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\styles.js":"6","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getMoovableSquares.js":"7","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\pawn.js":"8","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\index.js":"9","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\bishop.js":"10","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\rook.js":"11","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\queen.js":"12","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\knight.js":"13","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\king.js":"14","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\kingsCheckVerifier.js":"15","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getKingsPosition.js":"16","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getAttackedTiles.js":"17","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getLegalMoves.js":"18","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\validateMove.js":"19","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\movePiece.js":"20"},{"size":5907,"mtime":1614020097376,"results":"21","hashOfConfig":"22"},{"size":181,"mtime":1613579419299,"results":"23","hashOfConfig":"22"},{"size":1011,"mtime":1613678922901,"results":"24","hashOfConfig":"22"},{"size":1702,"mtime":1613563651038,"results":"25","hashOfConfig":"22"},{"size":2527,"mtime":1613736718989,"results":"26","hashOfConfig":"22"},{"size":1250,"mtime":1613688449518,"results":"27","hashOfConfig":"22"},{"size":863,"mtime":1613686680084,"results":"28","hashOfConfig":"22"},{"size":1840,"mtime":1613692212300,"results":"29","hashOfConfig":"22"},{"size":437,"mtime":1613581804222,"results":"30","hashOfConfig":"22"},{"size":3260,"mtime":1613664065013,"results":"31","hashOfConfig":"22"},{"size":2993,"mtime":1613649992447,"results":"32","hashOfConfig":"22"},{"size":215,"mtime":1613649966051,"results":"33","hashOfConfig":"22"},{"size":3137,"mtime":1613649884236,"results":"34","hashOfConfig":"22"},{"size":1760,"mtime":1613736025894,"results":"35","hashOfConfig":"22"},{"size":913,"mtime":1613705435837,"results":"36","hashOfConfig":"22"},{"size":878,"mtime":1613963318562,"results":"37","hashOfConfig":"22"},{"size":1288,"mtime":1613691108034,"results":"38","hashOfConfig":"22"},{"size":2732,"mtime":1613964155925,"results":"39","hashOfConfig":"22"},{"size":3853,"mtime":1613965548529,"results":"40","hashOfConfig":"22"},{"size":4296,"mtime":1614117152911,"results":"41","hashOfConfig":"22"},{"filePath":"42","messages":"43","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"44"},"966y19",{"filePath":"45","messages":"46","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"49","usedDeprecatedRules":"50"},{"filePath":"51","messages":"52","errorCount":0,"warningCount":25,"fixableErrorCount":0,"fixableWarningCount":0,"source":"53","usedDeprecatedRules":"54"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"59"},{"filePath":"60","messages":"61","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"62","messages":"63","errorCount":0,"warningCount":16,"fixableErrorCount":0,"fixableWarningCount":0,"source":"64","usedDeprecatedRules":"50"},{"filePath":"65","messages":"66","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"59"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"69","messages":"70","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"50"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"75"},{"filePath":"76","messages":"77","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"82","usedDeprecatedRules":"59"},{"filePath":"83","messages":"84","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"85","messages":"86","errorCount":0,"warningCount":3,"fixableErrorCount":0,"fixableWarningCount":0,"source":"87"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"90","messages":"91","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\Board.js",["92","93","94","95"],"import React, { useState, useEffect } from 'react';\r\n\r\nimport { BoardBase } from './styles.js';\r\nimport BoardTiles from './BoardTiles';\r\nimport { Container} from 'react-bootstrap';\r\n\r\nimport kingsCheckVerifier from './../Functions/kingsCheckVerifier'\r\nimport getKingsPosition from '../Functions/getKingsPosition.js';\r\n// import getAttackedTiles from '../Functions/getAttackedTiles.js';\r\nimport getLegalMoves from '../Functions/getLegalMoves.js';\r\n\r\n// import {Row, Col} from 'b'\r\nconst style ={\r\n position:'absolute', \r\n zIndex:-1, \r\n height: 30+'rem', \r\n width: 30+'rem', \r\n transform: `translate(-5.5%, 5.5%)`\r\n}\r\n \r\nfunction Board() {\r\n const [gameState, setgameState] = useState({\r\n FEN:'',\r\n PGN:'',\r\n piecePosition:[\r\n ['r','n','b', 'q','k','b','n','r'],\r\n ['p','p','p', 'p','p','p','p','p'],\r\n ['','','','','','','',''],\r\n ['','','','','','','',''],\r\n ['','','','','','','',''],\r\n ['','','','N','','P','',''],\r\n ['P','P','P', 'P','P','','b','P'],\r\n ['R','','', '','K','','','R'],\r\n ],\r\n enPassant:'C6',\r\n enPassantPawn: 'C5',\r\n castle:{\r\n whiteKingCastle: true,\r\n whiteQueenCastle: true,\r\n blackKingCastle: true,\r\n blackQueenCastle: true,\r\n },\r\n\r\n moveCounter: 0,\r\n semiMoveCounter: 0,\r\n turn: true, //true -> white, false->black\r\n\r\n whiteCheck: false,\r\n blackCheck: false,\r\n\r\n gameResult: 0,\r\n\r\n //0 -> Playing\r\n //1 -> Draw\r\n //2 -> White Won\r\n //3 -> Black Won\r\n \r\n });\r\n\r\n\r\n const [playerState, setplayerState] = useState({\r\n selectedPiece: '',\r\n selectedTile: '',\r\n legalMoves: [],\r\n });\r\n\r\n useEffect(() => {\r\n console.log(gameState)\r\n\r\n //get all legal moves, in the following strutucre\r\n // [\r\n // {\r\n // piece: '',\r\n // tile: '',\r\n // possibleMoves: ['','', ...],\r\n // },\r\n // ]\r\n kingsCheckVerifier(gameState, setgameState)\r\n getLegalMoves(gameState, setgameState, playerState, setplayerState);\r\n\r\n\r\n }, [gameState.turn])\r\n\r\n\r\n\r\n useEffect(() => { //show available tiles where you can move, when you select a piece\r\n\r\n \r\n //Clean Squares movable class from all Tiles (it gives a dot indicating the valid squares you can place a selected piece)\r\n for (let row = 0; row < 8; row++) {\r\n for (let column = 0; column < 8; column++) {\r\n\r\n document.getElementById(String.fromCharCode(65+column)+(8-row)).firstChild.classList.remove(\"movable\")\r\n }\r\n }\r\n\r\n playerState.legalMoves.forEach((item) =>{\r\n if(item.tile === playerState.selectedTile){\r\n item.possibleMoves.forEach((item, index)=>{\r\n document.getElementById(item).firstChild.classList.add(\"movable\")\r\n })\r\n }\r\n // if(item.tile == playerState.selectedTile) console.log(item.moves)\r\n })\r\n \r\n //applying movable class only in the valid tiles for the selected piece\r\n // playerState.allowedTilesMoves.forEach((item, index)=>{\r\n // document.getElementById(item).firstChild.classList.add(\"movable\")\r\n // })\r\n\r\n \r\n }, [playerState.selectedPiece, playerState.selectedTile])\r\n \r\n \r\n useEffect(() => {\r\n if(gameState.blackCheck){\r\n let king = getKingsPosition(gameState.piecePosition).blackKing\r\n document.getElementById(String.fromCharCode(65+king.col)+(8-king.row)).firstChild.classList.add(\"check\")\r\n }else{\r\n let king = getKingsPosition(gameState.piecePosition).blackKing\r\n document.getElementById(String.fromCharCode(65+king.col)+(8-king.row)).firstChild.classList.remove(\"check\")\r\n }\r\n // if(gameState.whiteCheck) console.log('White King Is InCheck');\r\n }, [gameState.blackCheck])\r\n\r\n\r\n useEffect(() => {\r\n if(gameState.whiteCheck){\r\n let king = getKingsPosition(gameState.piecePosition).whiteKing\r\n document.getElementById(String.fromCharCode(65+king.col)+(8-king.row)).firstChild.classList.add(\"check\")\r\n }else{\r\n let king = getKingsPosition(gameState.piecePosition).whiteKing\r\n document.getElementById(String.fromCharCode(65+king.col)+(8-king.row)).firstChild.classList.remove(\"check\")\r\n }\r\n // if(gameState.whiteCheck) console.log('White King Is InCheck');\r\n }, [gameState.whiteCheck])\r\n\r\n return (\r\n <Container style={{display:'flex', justifyContent:'center'}}>\r\n <svg style={style} viewBox=\"0 0 100 100\" class=\"coordinates outside\"><text x=\"2\" y=\"3.5\" font-size=\"3.5\" class=\"coordinate-grey\">8</text><text x=\"2\" y=\"16\" font-size=\"3.5\" class=\"coordinate-grey\">7</text><text x=\"2\" y=\"28.5\" font-size=\"3.5\" class=\"coordinate-grey\">6</text><text x=\"2\" y=\"41\" font-size=\"3.5\" class=\"coordinate-grey\">5</text><text x=\"2\" y=\"53.5\" font-size=\"3.5\" class=\"coordinate-grey\">4</text><text x=\"2\" y=\"66\" font-size=\"3.5\" class=\"coordinate-grey\">3</text><text x=\"2\" y=\"78.5\" font-size=\"3.5\" class=\"coordinate-grey\">2</text><text x=\"2\" y=\"91\" font-size=\"3.5\" class=\"coordinate-grey\">1</text><text x=\"10.35\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">A</text><text x=\"22.85\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">B</text><text x=\"35.35\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">C</text><text x=\"47.85\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">D</text><text x=\"60.35\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">E</text><text x=\"72.85\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">F</text><text x=\"85.35\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">G</text><text x=\"97.85\" y=\"99.25\" font-size=\"3.5\" class=\"coordinate-grey\">H</text></svg>\r\n <BoardBase class=\"board\">\r\n <BoardTiles \r\n gameState={gameState}\r\n setgameState={setgameState}\r\n playerState={playerState}\r\n setplayerState={setplayerState}\r\n />\r\n </BoardBase>\r\n \r\n </Container>\r\n );\r\n}\r\n\r\nexport default Board;","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\App.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\BoardTiles.js",["96","97","98","99"],"import React, { useState } from 'react';\r\n\r\nimport Tile from './../Components/Tile';\r\n\r\n\r\nexport default function BoardTiles({gameState,setgameState, playerState, setplayerState}) {\r\n let tiles = [];\r\n // console.log(gameState);\r\n\r\n for (let row = 0; row < 8; row++) {\r\n for (let column = 0; column < 8; column++) {\r\n let color = '';\r\n if(row%2 == 0){\r\n column%2 == 0 ? color='white' : color='dark';\r\n }else{\r\n column%2 == 0 ? color='dark' : color='white';\r\n }\r\n // console.log(gameState.piecePosition[row][column]);\r\n tiles.push(<Tile row={row} \r\n column={column} \r\n color={color}\r\n gameState={gameState}\r\n setgameState={setgameState}\r\n playerState={playerState}\r\n setplayerState={setplayerState}\r\n />\r\n )\r\n }\r\n }\r\n \r\n\r\n\r\n\r\n return (\r\n tiles\r\n )\r\n}\r\n\r\n",["100","101"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\ChoosePiece.js",["102","103","104","105","106","107","108","109","110","111","112","113","114","115","116","117","118","119","120","121","122","123","124","125","126"],"import { ReactComponent as Black_bishop } from './../svg/black_bishop.svg'\r\nimport { ReactComponent as Black_king } from './../svg/black_king.svg'\r\nimport { ReactComponent as Black_knight } from './../svg/black_knight.svg'\r\nimport { ReactComponent as Black_pawn } from './../svg/black_pawn.svg'\r\nimport { ReactComponent as Black_queen } from './../svg/black_queen.svg'\r\nimport { ReactComponent as Black_rook } from './../svg/black_rook.svg'\r\nimport { ReactComponent as White_bishop } from './../svg/white_bishop.svg'\r\nimport { ReactComponent as White_king } from './../svg/white_king.svg'\r\nimport { ReactComponent as White_knight } from './../svg/white_knight.svg'\r\nimport { ReactComponent as White_pawn } from './../svg/white_pawn.svg'\r\nimport { ReactComponent as White_queen } from './../svg/white_queen.svg'\r\nimport { ReactComponent as White_rook } from './../svg/white_rook.svg'\r\n\r\n\r\n\r\nimport React from 'react'\r\n\r\nexport default function ChoosePiece(piece) {\r\n switch (piece) {\r\n case 'r': return <Black_rook />; break;\r\n case 'b': return <Black_bishop />; break;\r\n case 'n': return <Black_knight />; break;\r\n case 'q': return <Black_queen />; break;\r\n case 'k': return <Black_king />; break;\r\n case 'p': return <Black_pawn/>; break;\r\n\r\n case 'R': return <White_rook />; break;\r\n case 'B': return <White_bishop />; break;\r\n case 'N': return <White_knight />; break;\r\n case 'Q': return <White_queen />; break;\r\n case 'K': return <White_king />; break;\r\n case 'P': return <White_pawn />; break;\r\n\r\n default: return null; break;\r\n }\r\n \r\n}\r\n",["127","128"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Components\\Tile.js",["129","130","131"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Board\\styles.js",[],["132","133"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getMoovableSquares.js",["134"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\pawn.js",["135","136","137","138","139","140","141","142","143","144","145","146","147","148","149","150"],"export default function pawn(piecePosition, row, column, enPassant) {\r\n\r\n // String.fromCharCode(65+column)+(8-row)\r\n\r\n // console.log(piecePosition, row, column, enPassant)\r\n let allowedSquares = [];\r\n let isWhite = 0;\r\n\r\n piecePosition[row][column] > {} ? isWhite=-1 : isWhite=1;\r\n\r\n //fowardMove\r\n\r\n //checks if there's not a piece in front of it\r\n if(piecePosition[row-isWhite][column] == \"\"){\r\n allowedSquares.push(String.fromCharCode(65+column)+(8-row+isWhite))\r\n if((row==6 && isWhite == 1) || (row==1 && isWhite == -1)){ //initial position\r\n if(piecePosition[row-2*isWhite][column] == \"\") allowedSquares.push(String.fromCharCode(65+column)+(8-row+2*isWhite))\r\n }\r\n }\r\n\r\n //captures right\r\n if(piecePosition[row-isWhite][column+1] != \"\"){\r\n if((piecePosition[row-isWhite][column+1] > {} && isWhite == 1) || (piecePosition[row-isWhite][column+1] < {} && isWhite == -1)) {\r\n allowedSquares.push(String.fromCharCode(65+column+1)+(8-row+isWhite));\r\n }\r\n }\r\n\r\n //captures left\r\n if(piecePosition[row-isWhite][column-1] != \"\"){\r\n if((piecePosition[row-isWhite][column-1] > {} && isWhite == 1) || (piecePosition[row-isWhite][column-1] < {} && isWhite == -1)) {\r\n allowedSquares.push(String.fromCharCode(65+column-1)+(8-row+isWhite));\r\n }\r\n }\r\n\r\n //en passant\r\n\r\n if(\r\n enPassant == String.fromCharCode(65+column-1)+(8-row+isWhite) ||\r\n enPassant == String.fromCharCode(65+column+1)+(8-row+isWhite) \r\n ){\r\n if(\r\n (piecePosition[row][column] > {} && enPassant.split(\"\")[1] == '3') ||\r\n (piecePosition[row][column] < {} && enPassant.split(\"\")[1] == '6') \r\n \r\n )\r\n allowedSquares.push(enPassant);\r\n }\r\n\r\n return allowedSquares;\r\n}\r\n\r\n","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\index.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\bishop.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\rook.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\queen.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\knight.js",[],["151","152"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\moovable\\king.js",["153"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\kingsCheckVerifier.js",[],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getKingsPosition.js",["154","155"],"\r\nexport default function getKingsPosition(piecePosition) {\r\n // console.log(piecePosition);\r\n\r\n \r\n let whiteKingsRow = 0, whiteKingsCloumn = 0;\r\n for (let i = 0; i < 8; i++) {\r\n if(piecePosition[i].indexOf(\"K\") != -1){\r\n whiteKingsCloumn = piecePosition[i].indexOf(\"K\");\r\n whiteKingsRow = i;\r\n break;\r\n }\r\n }\r\n\r\n let blackKingsRow = 0, blackKingsColoumn = 0;\r\n for (let i = 0; i < 8; i++) {\r\n if(piecePosition[i].indexOf(\"k\") != -1){\r\n blackKingsColoumn = piecePosition[i].indexOf(\"k\");\r\n blackKingsRow = i;\r\n break;\r\n }\r\n }\r\n \r\n return {\r\n whiteKing:{\r\n row: whiteKingsRow,\r\n col: whiteKingsCloumn,\r\n },\r\n blackKing:{\r\n row: blackKingsRow,\r\n col:blackKingsColoumn,\r\n }\r\n }\r\n}\r\n","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getAttackedTiles.js",["156"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\getLegalMoves.js",["157","158","159"],"import pawn from './moovable/pawn'\r\nimport bishop from './moovable/bishop'\r\nimport rook from './moovable/rook'\r\nimport queen from './moovable/queen'\r\nimport knight from './moovable/knight'\r\nimport king from './moovable/king'\r\nimport validateMove from './validateMove'\r\n\r\nexport default function getLegalMoves(gameState, setgameState, playerState, setplayerState) {\r\n // console.log('cheguei aqui');\r\n let moves = [];\r\n\r\n for (let i = 0; i < 8; i++) {\r\n for (let j = 0; j < 8; j++) {\r\n if(\r\n (gameState.turn && gameState.piecePosition[i][j]!= \"\" && gameState.piecePosition[i][j] < {})||\r\n (!gameState.turn && gameState.piecePosition[i][j]!= \"\" && gameState.piecePosition[i][j] > {})\r\n )moves= [...moves, String.fromCharCode(65+j)+(8-i)]\r\n\r\n }\r\n }\r\n\r\n moves.forEach(item => {\r\n let moveSet =[]\r\n // console.log(8-item[1], item.charCodeAt(0)-65, gameState.piecePosition[8-item[1]][item.charCodeAt(0)-65])\r\n switch (gameState.piecePosition[8-item[1]][item.charCodeAt(0)-65].toUpperCase()) {\r\n case 'B': moveSet = (bishop(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65)); break;\r\n case 'R': moveSet = (rook(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65)); break;\r\n case 'N': moveSet = (knight(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65)); break;\r\n case 'Q': moveSet = (queen(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65)); break;\r\n case 'K': moveSet = (king(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65, gameState.castle, gameState.whiteCheck, gameState.blackCheck)); break;\r\n case 'P': moveSet = (pawn(gameState.piecePosition, 8-item[1], item.charCodeAt(0)-65, gameState.enPassant)); break;\r\n }\r\n // console.log(moveSet);\r\n \r\n moves = [\r\n ...moves,\r\n {\r\n piece: gameState.piecePosition[8-item[1]][item.charCodeAt(0)-65],\r\n tile: item,\r\n possibleMoves: moveSet\r\n }\r\n ]\r\n moves.shift();\r\n });\r\n\r\n moves.forEach(item => {\r\n item.possibleMoves.forEach((move, index, object) => {\r\n // console.log(item.tile, move)\r\n if(!validateMove(gameState.piecePosition, item.piece, item.tile, move, gameState.turn, gameState.castle, gameState.enPassant, gameState.whiteCheck, gameState.blackCheck)){\r\n object[index] = \"\"\r\n }\r\n \r\n });\r\n item.possibleMoves = item.possibleMoves.filter(Boolean);\r\n })\r\n // console.log(moves)\r\n\r\n setplayerState({\r\n ...playerState,\r\n legalMoves: moves\r\n })\r\n\r\n\r\n\r\n}\r\n","C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\validateMove.js",["160","161","162","163"],"C:\\Users\\samue\\OneDrive\\Documentos\\Sites\\xadrez\\src\\Functions\\movePiece.js",["164","165"],{"ruleId":"166","severity":1,"message":"167","line":82,"column":6,"nodeType":"168","endLine":82,"endColumn":22,"suggestions":"169"},{"ruleId":"166","severity":1,"message":"170","line":112,"column":6,"nodeType":"168","endLine":112,"endColumn":59,"suggestions":"171"},{"ruleId":"166","severity":1,"message":"172","line":124,"column":6,"nodeType":"168","endLine":124,"endColumn":28,"suggestions":"173"},{"ruleId":"166","severity":1,"message":"172","line":136,"column":6,"nodeType":"168","endLine":136,"endColumn":28,"suggestions":"174"},{"ruleId":"175","severity":1,"message":"176","line":1,"column":17,"nodeType":"177","messageId":"178","endLine":1,"endColumn":25},{"ruleId":"179","severity":1,"message":"180","line":13,"column":22,"nodeType":"181","messageId":"182","endLine":13,"endColumn":24},{"ruleId":"179","severity":1,"message":"180","line":14,"column":26,"nodeType":"181","messageId":"182","endLine":14,"endColumn":28},{"ruleId":"179","severity":1,"message":"180","line":16,"column":26,"nodeType":"181","messageId":"182","endLine":16,"endColumn":28},{"ruleId":"183","replacedBy":"184"},{"ruleId":"185","replacedBy":"186"},{"ruleId":"187","severity":1,"message":"188","line":20,"column":30,"nodeType":"189","endLine":20,"endColumn":44},{"ruleId":"190","severity":1,"message":"191","line":20,"column":46,"nodeType":"192","messageId":"193","endLine":20,"endColumn":52},{"ruleId":"187","severity":1,"message":"194","line":21,"column":30,"nodeType":"189","endLine":21,"endColumn":46},{"ruleId":"190","severity":1,"message":"191","line":21,"column":48,"nodeType":"192","messageId":"193","endLine":21,"endColumn":54},{"ruleId":"187","severity":1,"message":"195","line":22,"column":30,"nodeType":"189","endLine":22,"endColumn":46},{"ruleId":"190","severity":1,"message":"191","line":22,"column":48,"nodeType":"192","messageId":"193","endLine":22,"endColumn":54},{"ruleId":"187","severity":1,"message":"196","line":23,"column":30,"nodeType":"189","endLine":23,"endColumn":45},{"ruleId":"190","severity":1,"message":"191","line":23,"column":47,"nodeType":"192","messageId":"193","endLine":23,"endColumn":53},{"ruleId":"187","severity":1,"message":"197","line":24,"column":30,"nodeType":"189","endLine":24,"endColumn":44},{"ruleId":"190","severity":1,"message":"191","line":24,"column":46,"nodeType":"192","messageId":"193","endLine":24,"endColumn":52},{"ruleId":"187","severity":1,"message":"198","line":25,"column":30,"nodeType":"189","endLine":25,"endColumn":43},{"ruleId":"190","severity":1,"message":"191","line":25,"column":45,"nodeType":"192","messageId":"193","endLine":25,"endColumn":51},{"ruleId":"187","severity":1,"message":"199","line":27,"column":30,"nodeType":"189","endLine":27,"endColumn":44},{"ruleId":"190","severity":1,"message":"191","line":27,"column":46,"nodeType":"192","messageId":"193","endLine":27,"endColumn":52},{"ruleId":"187","severity":1,"message":"200","line":28,"column":30,"nodeType":"189","endLine":28,"endColumn":46},{"ruleId":"190","severity":1,"message":"191","line":28,"column":48,"nodeType":"192","messageId":"193","endLine":28,"endColumn":54},{"ruleId":"187","severity":1,"message":"201","line":29,"column":30,"nodeType":"189","endLine":29,"endColumn":46},{"ruleId":"190","severity":1,"message":"191","line":29,"column":48,"nodeType":"192","messageId":"193","endLine":29,"endColumn":54},{"ruleId":"187","severity":1,"message":"202","line":30,"column":30,"nodeType":"189","endLine":30,"endColumn":45},{"ruleId":"190","severity":1,"message":"191","line":30,"column":47,"nodeType":"192","messageId":"193","endLine":30,"endColumn":53},{"ruleId":"187","severity":1,"message":"203","line":31,"column":30,"nodeType":"189","endLine":31,"endColumn":44},{"ruleId":"190","severity":1,"message":"191","line":31,"column":46,"nodeType":"192","messageId":"193","endLine":31,"endColumn":52},{"ruleId":"187","severity":1,"message":"204","line":32,"column":30,"nodeType":"189","endLine":32,"endColumn":44},{"ruleId":"190","severity":1,"message":"191","line":32,"column":46,"nodeType":"192","messageId":"193","endLine":32,"endColumn":52},{"ruleId":"190","severity":1,"message":"191","line":34,"column":35,"nodeType":"192","messageId":"193","endLine":34,"endColumn":41},{"ruleId":"183","replacedBy":"205"},{"ruleId":"185","replacedBy":"206"},{"ruleId":"175","severity":1,"message":"207","line":10,"column":27,"nodeType":"177","messageId":"178","endLine":10,"endColumn":43},{"ruleId":"179","severity":1,"message":"180","line":30,"column":42,"nodeType":"181","messageId":"182","endLine":30,"endColumn":44},{"ruleId":"179","severity":1,"message":"180","line":30,"column":103,"nodeType":"181","messageId":"182","endLine":30,"endColumn":105},{"ruleId":"183","replacedBy":"208"},{"ruleId":"185","replacedBy":"209"},{"ruleId":"210","severity":1,"message":"211","line":10,"column":5,"nodeType":"212","messageId":"213","endLine":17,"endColumn":6},{"ruleId":"179","severity":1,"message":"180","line":14,"column":43,"nodeType":"181","messageId":"182","endLine":14,"endColumn":45},{"ruleId":"179","severity":1,"message":"180","line":16,"column":16,"nodeType":"181","messageId":"182","endLine":16,"endColumn":18},{"ruleId":"179","severity":1,"message":"180","line":16,"column":31,"nodeType":"181","messageId":"182","endLine":16,"endColumn":33},{"ruleId":"179","severity":1,"message":"180","line":16,"column":44,"nodeType":"181","messageId":"182","endLine":16,"endColumn":46},{"ruleId":"179","severity":1,"message":"180","line":16,"column":59,"nodeType":"181","messageId":"182","endLine":16,"endColumn":61},{"ruleId":"179","severity":1,"message":"180","line":17,"column":53,"nodeType":"181","messageId":"182","endLine":17,"endColumn":55},{"ruleId":"179","severity":1,"message":"214","line":22,"column":45,"nodeType":"181","messageId":"182","endLine":22,"endColumn":47},{"ruleId":"179","severity":1,"message":"180","line":23,"column":66,"nodeType":"181","messageId":"182","endLine":23,"endColumn":68},{"ruleId":"179","severity":1,"message":"180","line":23,"column":129,"nodeType":"181","messageId":"182","endLine":23,"endColumn":131},{"ruleId":"179","severity":1,"message":"214","line":29,"column":45,"nodeType":"181","messageId":"182","endLine":29,"endColumn":47},{"ruleId":"179","severity":1,"message":"180","line":30,"column":66,"nodeType":"181","messageId":"182","endLine":30,"endColumn":68},{"ruleId":"179","severity":1,"message":"180","line":30,"column":129,"nodeType":"181","messageId":"182","endLine":30,"endColumn":131},{"ruleId":"179","severity":1,"message":"180","line":38,"column":19,"nodeType":"181","messageId":"182","endLine":38,"endColumn":21},{"ruleId":"179","severity":1,"message":"180","line":39,"column":19,"nodeType":"181","messageId":"182","endLine":39,"endColumn":21},{"ruleId":"179","severity":1,"message":"180","line":42,"column":72,"nodeType":"181","messageId":"182","endLine":42,"endColumn":74},{"ruleId":"179","severity":1,"message":"180","line":43,"column":72,"nodeType":"181","messageId":"182","endLine":43,"endColumn":74},{"ruleId":"183","replacedBy":"215"},{"ruleId":"185","replacedBy":"216"},{"ruleId":"175","severity":1,"message":"217","line":1,"column":8,"nodeType":"177","messageId":"178","endLine":1,"endColumn":24},{"ruleId":"179","severity":1,"message":"214","line":8,"column":42,"nodeType":"181","messageId":"182","endLine":8,"endColumn":44},{"ruleId":"179","severity":1,"message":"214","line":17,"column":42,"nodeType":"181","messageId":"182","endLine":17,"endColumn":44},{"ruleId":"210","severity":1,"message":"211","line":17,"column":13,"nodeType":"212","messageId":"213","endLine":24,"endColumn":14},{"ruleId":"179","severity":1,"message":"214","line":16,"column":65,"nodeType":"181","messageId":"182","endLine":16,"endColumn":67},{"ruleId":"179","severity":1,"message":"214","line":17,"column":66,"nodeType":"181","messageId":"182","endLine":17,"endColumn":68},{"ruleId":"210","severity":1,"message":"211","line":26,"column":9,"nodeType":"212","messageId":"213","endLine":33,"endColumn":10},{"ruleId":"179","severity":1,"message":"214","line":29,"column":55,"nodeType":"181","messageId":"182","endLine":29,"endColumn":57},{"ruleId":"179","severity":1,"message":"214","line":30,"column":56,"nodeType":"181","messageId":"182","endLine":30,"endColumn":58},{"ruleId":"210","severity":1,"message":"211","line":39,"column":9,"nodeType":"212","messageId":"213","endLine":46,"endColumn":10},{"ruleId":"190","severity":1,"message":"191","line":92,"column":5,"nodeType":"218","messageId":"193","endLine":92,"endColumn":16},{"ruleId":"179","severity":1,"message":"180","line":110,"column":32,"nodeType":"181","messageId":"182","endLine":110,"endColumn":34},{"ruleId":"179","severity":1,"message":"180","line":110,"column":63,"nodeType":"181","messageId":"182","endLine":110,"endColumn":65},"react-hooks/exhaustive-deps","React Hook useEffect has missing dependencies: 'gameState' and 'playerState'. Either include them or remove the dependency array.","ArrayExpression",["219"],"React Hook useEffect has a missing dependency: 'playerState.legalMoves'. Either include it or remove the dependency array.",["220"],"React Hook useEffect has a missing dependency: 'gameState.piecePosition'. Either include it or remove the dependency array.",["221"],["222"],"no-unused-vars","'useState' is defined but never used.","Identifier","unusedVar","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","no-native-reassign",["223"],"no-negated-in-lhs",["224"],"react/jsx-pascal-case","Imported JSX component Black_rook must be in PascalCase or SCREAMING_SNAKE_CASE","JSXOpeningElement","no-unreachable","Unreachable code.","BreakStatement","unreachableCode","Imported JSX component Black_bishop must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component Black_knight must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component Black_queen must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component Black_king must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component Black_pawn must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_rook must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_bishop must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_knight must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_queen must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_king must be in PascalCase or SCREAMING_SNAKE_CASE","Imported JSX component White_pawn must be in PascalCase or SCREAMING_SNAKE_CASE",["223"],["224"],"'setisHighlighted' is assigned a value but never used.",["223"],["224"],"default-case","Expected a default case.","SwitchStatement","missingDefaultCase","Expected '!==' and instead saw '!='.",["223"],["224"],"'getAttackedTiles' is defined but never used.","ReturnStatement",{"desc":"225","fix":"226"},{"desc":"227","fix":"228"},{"desc":"229","fix":"230"},{"desc":"231","fix":"232"},"no-global-assign","no-unsafe-negation","Update the dependencies array to be: [gameState, gameState.turn, playerState]",{"range":"233","text":"234"},"Update the dependencies array to be: [playerState.legalMoves, playerState.selectedPiece, playerState.selectedTile]",{"range":"235","text":"236"},"Update the dependencies array to be: [gameState.blackCheck, gameState.piecePosition]",{"range":"237","text":"238"},"Update the dependencies array to be: [gameState.piecePosition, gameState.whiteCheck]",{"range":"239","text":"240"},[2008,2024],"[gameState, gameState.turn, playerState]",[3060,3113],"[playerState.legalMoves, playerState.selectedPiece, playerState.selectedTile]",[3654,3676],"[gameState.blackCheck, gameState.piecePosition]",[4213,4235],"[gameState.piecePosition, gameState.whiteCheck]"]