correction du draw pour tictactoe online
continuous-integration/drone/push Build is passing Details

peristanceBDD
Thomas Chazot 2 years ago
parent 2d14f83813
commit b8138127dc

@ -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"){

@ -20,7 +20,7 @@ export default interface ISaverUser{
* updateUser methode that update a User in the data management system * updateUser methode that update a User in the data management system
* u the user we want to update * u the user we want to update
*/ */
updateUser(u:User | null): Promise<void>; updateUser(u:User | null): Promise<void>;
addSkinList(u: User, s:Skin): Promise<void>; addSkinList(u: User, s:Skin): Promise<void>;

Loading…
Cancel
Save