Merge branch 'peristanceBDD' of https://codefirst.iut.uca.fr/git/BOB_PARTEAM/BOB_PARTY into peristanceBDD
continuous-integration/drone/push Build is passing Details

peristanceBDD
Alban GUILHOT 2 years ago
commit baf5748804

@ -60,14 +60,15 @@ export default function TicTacToeOnline(props: { navigation: any }){
function setUpTicTacToeOnline() { function setUpTicTacToeOnline() {
if (initTic===0){ if (initTic===0){
setInitTic(1); setInitTic(1);
socket.on("oppPlayTicTacToe", (rowIndex, columnIndex, turn) =>{ socket.on("oppPlayTicTacToe", async (rowIndex, columnIndex, turn) =>{
setMap((existingMap) =>{ setMap((existingMap) =>{
const updateMap = [...existingMap] const updateMap = [...existingMap]
updateMap[rowIndex][columnIndex]=turn; updateMap[rowIndex][columnIndex]=turn;
return updateMap; return updateMap;
}); });
if (!checkWinning()){ const retour= await checkWinning();
if(retour!=true){
checkComplete(); checkComplete();
} }
if (turn==="x"){ if (turn==="x"){

Loading…
Cancel
Save