Skip to content

Instantly share code, notes, and snippets.

@dacharya64
Created August 12, 2018 19:00
Show Gist options
  • Save dacharya64/4825499dfe9b6c802f61b2e81d5138fe to your computer and use it in GitHub Desktop.
Save dacharya64/4825499dfe9b6c802f61b2e81d5138fe to your computer and use it in GitHub Desktop.
[GSoC Light and Shadow] Incrementing Score and Sending Event on Authority System
private void incrementScore(LASTeamComponent baseTeamComponent) {
if (baseTeamComponent.team.equals(LASUtils.RED_TEAM)) {
redScore++;
// Send event to clients to update their Score UI
sendEventToClients(new ScoreUpdateFromServerEvent(LASUtils.RED_TEAM, redScore));
return;
}
if (baseTeamComponent.team.equals(LASUtils.BLACK_TEAM)) {
blackScore++;
// Send event to clients to update their Score UI
sendEventToClients(new ScoreUpdateFromServerEvent(LASUtils.BLACK_TEAM, blackScore));
return;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment