Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.props.localUserKey === this.props.players[i].playerKey) {
team = this.props.players[i].team
playerHasFlag = this.props.players[i].hasFlag
}
}
// TEAM WIN LOGIC: if red player has red flag and is inside the red territory, red team wins
if (
playerHasFlag === true && team === 'red' && geolib.isPointInside(
{ latitude: this.state.latitude, longitude: this.state.longitude },
redCoordinates
)
) {
this.setState({ displayStatus: "Red Team Wins!"})
} else if (
playerHasFlag === true && team === 'blue' && geolib.isPointInside(
{ latitude: this.state.latitude, longitude: this.state.longitude },
blueCoordinates
)
) {
this.setState({ displayStatus: "Blue Team Wins!"})
}
};
this.setState({ displayStatus: "" });
}
let team = '';
let playerHasFlag = false;
for (let i=0; i
.filter(x => geolib.isPointInside(x.location, query.searchArea))
.do(x => incrementCounter(summary, 'within_polygon', x.length))