|
|
|
@ -26,6 +26,7 @@ interface MyGraphComponentProps {
|
|
|
|
|
isEasy: boolean
|
|
|
|
|
setNetwork: (network: Network) => void
|
|
|
|
|
showLast: boolean
|
|
|
|
|
setPlayerIndex: (playerIndex: number) => void
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let lastAskingPlayer = 0
|
|
|
|
@ -42,11 +43,12 @@ let cptHistory = 0
|
|
|
|
|
let lastNodes: NodePerson[] = []
|
|
|
|
|
let cptEndgame = 0
|
|
|
|
|
let firstEnigme = true
|
|
|
|
|
let firstIndex = true
|
|
|
|
|
let endgame= false
|
|
|
|
|
let firstHistory = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork}) => {
|
|
|
|
|
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork, setPlayerIndex}) => {
|
|
|
|
|
let cptTour: number = 0
|
|
|
|
|
|
|
|
|
|
//* Gestion du temps :
|
|
|
|
@ -116,6 +118,11 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
|
}, [showLast])
|
|
|
|
|
|
|
|
|
|
let playerIndex: number = turnPlayerIndex
|
|
|
|
|
|
|
|
|
|
if (firstIndex){
|
|
|
|
|
firstIndex=false
|
|
|
|
|
setPlayerIndex(playerIndex)
|
|
|
|
|
}
|
|
|
|
|
let index = 0
|
|
|
|
|
for (let i=0; i<players.length; i++){
|
|
|
|
|
if(players[i].id == socket.id){
|
|
|
|
@ -340,6 +347,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
|
if (node!=undefined){
|
|
|
|
|
onNodeClick(false)
|
|
|
|
|
playerIndex = newPlayerIndex
|
|
|
|
|
setPlayerIndex(playerIndex)
|
|
|
|
|
if (mapIndexPersons.get(askedIndex)?.find((p) => p.getId() == id) == undefined){
|
|
|
|
|
const p = personNetwork.getPersons().find((p)=> p.getId() == id)
|
|
|
|
|
const tab = mapIndexPersons.get(askedIndex)
|
|
|
|
|