|
|
@ -23,6 +23,7 @@ interface MyGraphComponentProps {
|
|
|
|
addToHistory: (message : string) => void
|
|
|
|
addToHistory: (message : string) => void
|
|
|
|
solo : boolean
|
|
|
|
solo : boolean
|
|
|
|
isDaily : boolean
|
|
|
|
isDaily : boolean
|
|
|
|
|
|
|
|
isEasy: boolean
|
|
|
|
setNetwork: (network: Network) => void
|
|
|
|
setNetwork: (network: Network) => void
|
|
|
|
showLast: boolean
|
|
|
|
showLast: boolean
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -42,9 +43,10 @@ let lastNodes: NodePerson[] = []
|
|
|
|
let cptEndgame = 0
|
|
|
|
let cptEndgame = 0
|
|
|
|
let firstEnigme = true
|
|
|
|
let firstEnigme = true
|
|
|
|
let endgame= false
|
|
|
|
let endgame= false
|
|
|
|
|
|
|
|
let firstHistory = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, addToHistory, showLast, setNetwork}) => {
|
|
|
|
const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleShowTurnBar, handleTurnBarTextChange, playerTouched, setPlayerTouched, changecptTour, solo, isDaily, isEasy, addToHistory, showLast, setNetwork}) => {
|
|
|
|
let cptTour: number = 0
|
|
|
|
let cptTour: number = 0
|
|
|
|
|
|
|
|
|
|
|
|
//* Gestion du temps :
|
|
|
|
//* Gestion du temps :
|
|
|
@ -283,16 +285,26 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
setNetwork(network)
|
|
|
|
setNetwork(network)
|
|
|
|
|
|
|
|
|
|
|
|
if (isDaily){
|
|
|
|
if (isDaily){
|
|
|
|
dailyEnigme.forEach((pairs, index) => {
|
|
|
|
if (!isEasy){
|
|
|
|
pairs.forEach((pair) => {
|
|
|
|
dailyEnigme.forEach((pairs, index) => {
|
|
|
|
const i = indices.findIndex((indice) => pair.first.getId() === indice.getId())
|
|
|
|
pairs.forEach((pair) => {
|
|
|
|
const node = networkData.nodes.get().find((n) => index == n.id)
|
|
|
|
const i = indices.findIndex((indice) => pair.first.getId() === indice.getId())
|
|
|
|
if (node != undefined){
|
|
|
|
const node = networkData.nodes.get().find((n) => index == n.id)
|
|
|
|
networkData.nodes.update({id: node.id, label: node.label + positionToEmoji(i, pair.second)})
|
|
|
|
if (node != undefined){
|
|
|
|
const test = networkData.nodes.get().find((n) => index == n.id)
|
|
|
|
networkData.nodes.update({id: node.id, label: node.label + positionToEmoji(i, pair.second)})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else{
|
|
|
|
|
|
|
|
if (firstHistory){
|
|
|
|
|
|
|
|
firstHistory=false
|
|
|
|
|
|
|
|
indices.forEach((indice, index) => {
|
|
|
|
|
|
|
|
addToHistory("Indice " + positionToEmoji(index, true) + " : " + indice.ToString("fr"))
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
socket.on("reset graph", () => {
|
|
|
|
socket.on("reset graph", () => {
|
|
|
@ -429,7 +441,9 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
if (firstLap){
|
|
|
|
if (firstLap){
|
|
|
|
firstLap=false
|
|
|
|
firstLap=false
|
|
|
|
addToHistory("<----- [Tour " + 1 +"/"+networkData.nodes.length + "] ----->");
|
|
|
|
if (!isDaily){
|
|
|
|
|
|
|
|
addToHistory("<----- [Tour " + 1 +"/"+networkData.nodes.length + "] ----->");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -501,7 +515,7 @@ const MyGraphComponent: React.FC<MyGraphComponentProps> = ({onNodeClick, handleS
|
|
|
|
askedWrong=false
|
|
|
|
askedWrong=false
|
|
|
|
askedWrongBot=false
|
|
|
|
askedWrongBot=false
|
|
|
|
endgame = true
|
|
|
|
endgame = true
|
|
|
|
|
|
|
|
firstHistory=true
|
|
|
|
try{
|
|
|
|
try{
|
|
|
|
if(isLoggedIn){
|
|
|
|
if(isLoggedIn){
|
|
|
|
if(!solo){
|
|
|
|
if(!solo){
|
|
|
|