MAPG-235 refactor: renamed fields in challenge related tables
This commit is contained in:
1 parent
7a1674fdd0
commit
7792f1c3ff
8 files changed
+36
-38
No files matched your search
@@ -113,7 +113,7 @@ class GameController
|
||||
$challenge->setCreatedDate(new DateTime());
|
||||
|
||||
if($this->request->post('timerEnabled') !== null && $this->request->post('timeLimit') !== null) {
|
||||
$challenge->setTimerSec($this->request->post('timeLimit'));
|
||||
$challenge->setTimeLimit($this->request->post('timeLimit'));
|
||||
}
|
||||
if($this->request->post('noMove') !== null) {
|
||||
$challenge->setNoMove(true);
|
||||
@@ -135,7 +135,7 @@ class GameController
|
||||
$userInChallenge = new UserInChallenge();
|
||||
$userInChallenge->setUserId($userId);
|
||||
$userInChallenge->setChallenge($challenge);
|
||||
$userInChallenge->setTimeLeft($challenge->getTimerSec());
|
||||
$userInChallenge->setTimeLeft($challenge->getTimeLimit());
|
||||
$userInChallenge->setIsOwner(true);
|
||||
|
||||
$this->pdm->saveToDb($userInChallenge);
|
||||
@@ -147,12 +147,12 @@ class GameController
|
||||
|
||||
$places = $this->placeRepository->getRandomNPlaces($mapId, static::NUMBER_OF_ROUNDS, $userId);
|
||||
|
||||
$order = 1;
|
||||
$round = 0;
|
||||
foreach ($places as $place) {
|
||||
$placeInChallenge = new PlaceInChallenge();
|
||||
$placeInChallenge->setPlace($place);
|
||||
$placeInChallenge->setChallenge($challenge);
|
||||
$placeInChallenge->setOrder($order++);
|
||||
$placeInChallenge->setRound($round++);
|
||||
$this->pdm->saveToDb($placeInChallenge);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ class GameController
|
||||
$userInChallenge = new UserInChallenge();
|
||||
$userInChallenge->setUserId($userId);
|
||||
$userInChallenge->setChallenge($challenge);
|
||||
$userInChallenge->setTimeLeft($challenge->getTimerSec());
|
||||
$userInChallenge->setTimeLeft($challenge->getTimeLimit());
|
||||
$this->pdm->saveToDb($userInChallenge);
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ class GameFlowController
|
||||
}
|
||||
|
||||
$challenge = $userInChallenge->getChallenge();
|
||||
$currentRound = $userInChallenge->getRound();
|
||||
$currentRound = $userInChallenge->getCurrentRound();
|
||||
$currentPlace = $this->placeRepository->getByRoundInChallenge($challenge, $currentRound);
|
||||
|
||||
$response = [];
|
||||
@@ -316,7 +316,7 @@ class GameFlowController
|
||||
}
|
||||
|
||||
$challenge = $userInChallenge->getChallenge();
|
||||
$currentRound = $userInChallenge->getRound();
|
||||
$currentRound = $userInChallenge->getCurrentRound();
|
||||
$currentPlace = $this->placeRepository->getByRoundInChallenge($challenge, $currentRound);
|
||||
$map = $this->mapRepository->getByPlace($currentPlace);
|
||||
$placeInChallenge = $this->placeInChallengeRepository->getByPlaceAndChallenge($currentPlace, $challenge);
|
||||
@@ -355,7 +355,7 @@ class GameFlowController
|
||||
// update round
|
||||
$nextRound = $currentRound + 1;
|
||||
|
||||
$userInChallenge->setRound($nextRound);
|
||||
$userInChallenge->setCurrentRound($nextRound);
|
||||
$this->pdm->saveToDb($userInChallenge);
|
||||
|
||||
if ($nextRound < static::NUMBER_OF_ROUNDS) {
|
||||
|
||||
Reference in new issue
Block a user