Example #1
0
 public function resolveRoll(\diceBattleBundle\Entity\User $user, $userRoll, $opponentRoll, $opponentFpBounty)
 {
     if ($userRoll > $opponentRoll) {
         $user->updateWinResultGmd($opponentFpBounty);
         $this->resultMsgKey = 'win.msg.key';
         $user->updateWinStreak();
     }
     if ($userRoll < $opponentRoll) {
         $user->updateLossResultGmd($opponentFpBounty);
         $this->resultMsgKey = 'loss.msg.key';
         $user->updateLosingStreak();
     }
     if ($userRoll == $opponentRoll) {
         $user->updateDrawResultGmd($opponentFpBounty);
         $this->resultMsgKey = 'draw.msg.key';
         $user->updateDrawStreak();
     }
     return $user;
 }