Compare commits
2 Commits
7970927654
...
1c1e5f051d
Author | SHA1 | Date | |
---|---|---|---|
1c1e5f051d | |||
283c214c50 |
@ -21,7 +21,6 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
|
||||
googleLink: null,
|
||||
history: [],
|
||||
restrictions: null,
|
||||
finishers: null,
|
||||
|
||||
readyToContinue: true,
|
||||
timeoutEnd: null,
|
||||
@ -488,10 +487,6 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (response.finishers) {
|
||||
Game.finishers = new Set(response.finishers);
|
||||
}
|
||||
},
|
||||
|
||||
reset: function () {
|
||||
@ -544,7 +539,6 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
|
||||
document.getElementById('panningBlockerCover').style.display = null;
|
||||
|
||||
Game.history = [];
|
||||
Game.finishers = null;
|
||||
|
||||
Game.initialize();
|
||||
},
|
||||
@ -873,16 +867,21 @@ const GameType = Object.freeze({ 'SINGLE': 0, 'MULTI': 1, 'CHALLENGE': 2 });
|
||||
var highscores = new Map();
|
||||
highscores.set('me', Game.scoreSum);
|
||||
|
||||
for (var i = 0; i < Game.history.length; ++i) {
|
||||
// collect the results of users who are through the last round
|
||||
const round = Game.history[Game.history.length - 1];
|
||||
if (round.allResults) {
|
||||
for (const result of round.allResults) {
|
||||
highscores.set(result.userName, result.score);
|
||||
}
|
||||
}
|
||||
|
||||
// add up scores only for the finishers
|
||||
for (var i = Game.history.length - 2; i >= 0; --i) {
|
||||
const round = Game.history[i];
|
||||
if (round.allResults) {
|
||||
for (const result of round.allResults) {
|
||||
if (Game.finishers.has(result.userName)) {
|
||||
if (highscores.has(result.userName)) {
|
||||
highscores.set(result.userName, highscores.get(result.userName) + result.score);
|
||||
} else {
|
||||
highscores.set(result.userName, result.score);
|
||||
}
|
||||
if (highscores.has(result.userName)) {
|
||||
highscores.set(result.userName, highscores.get(result.userName) + result.score);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -199,14 +199,6 @@ class GameFlowController implements ISecured
|
||||
|
||||
if (!isset($currentPlace)) { // game finished
|
||||
$response['finished'] = true;
|
||||
|
||||
// list all players who finished the challenge
|
||||
$response['finishers'] = [];
|
||||
foreach ($this->userInChallengeRepository->getAllByChallengeWithUsers($challenge) as $userInChallenge) {
|
||||
if ($userInChallenge->getCurrentRound() == $currentRound && $userInChallenge->getUser()->getId() != $userId) {
|
||||
$response['finishers'][] = $userInChallenge->getUser()->getDisplayName();
|
||||
}
|
||||
}
|
||||
} else { // continue game
|
||||
$response['place'] = [
|
||||
'panoId' => $currentPlace->getPanoIdCached(),
|
||||
|
@ -67,7 +67,7 @@ TODO: condition!
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="noZoom" name="noZoom" value="noZoom" />
|
||||
<label for="noMove">No zoom allowed</label>
|
||||
<label for="noZoom">No zoom allowed</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" id="noPan" name="noPan" value="noPan" />
|
||||
|
Loading…
Reference in New Issue
Block a user