Ejemplo n.º 1
0
        public void SetValues(GameMetrics gameMetrics)
        {
            for (int i = 0; i < 3; i++)
            {
                stars[i].gameObject.SetActive(i < gameMetrics.GetStars());
            }
            score.text = "" + gameMetrics.GetScore();
//            scorePercentage = (int)(((gameMetrics.GetScore() + 0f) / (MetricsController.GetController().GetMaxScore() + 0f)) * 100);
            correct.text   = "" + gameMetrics.GetRightAnswers();
            incorrect.text = "" + gameMetrics.GetWrongAnswers();
            Invoke("IncrementProgressBar", 0.1f);
            RangeText.text     = gameMetrics.GetRange().ToString();
            BonusTimeText.text = "" + gameMetrics.GetBonusTime();
        }
Ejemplo n.º 2
0
 public void SetValues(GameMetrics gameMetrics)
 {
     for (int i = 0; i < 3; i++)
     {
         stars[i].gameObject.SetActive(i < gameMetrics.GetStars());
     }
     score.text = "" + gameMetrics.GetScore();
     scorePercentage = (int)(((gameMetrics.GetScore() + 0f) / (MetricsController.GetController().GetMaxScore() + 0f)) * 100);
     correct.text = "" + gameMetrics.GetRightAnswers();
     incorrect.text = "" + gameMetrics.GetWrongAnswers();
     Invoke("IncrementProgressBar", 0.1f);
     RangeText.text = gameMetrics.GetRange().ToString();
     BonusTimeText.text = "" + gameMetrics.GetBonusTime();
 }
 internal void SetData(GameMetrics playerOneMetrics, GameMetrics playerTwoMetrics, int winner)
 {
     int language = Settings.SettingsController.GetController().GetLanguage();
     if (winner < 1)
     {
         this.winner.text = "";
         this.winnerSentece.text = language == 0 ? "EMPATE" : "DRAW";
     }
     else
     {
         this.winner.text =  (language == 0 ? "JUGADOR " : "PLAYER") + winner;
         this.winnerSentece.text = language == 0 ? "GANADOR" : "WINNER";
     }
     playerOneCorrect.text = "" + playerOneMetrics.GetRightAnswers();
     playerOneWrong.text = "" + playerOneMetrics.GetWrongAnswers();
     playerTwoCorrect.text = "" + playerTwoMetrics.GetRightAnswers();
     playerTwoWrong.text = "" + playerTwoMetrics.GetWrongAnswers();
     this.gameObject.SetActive(true);
     SoundController.GetController().PlayLevelCompleteSound();
 }
Ejemplo n.º 4
0
        private void groupGames(List<GameMetrics> metrics)
        {
            int gruopSize = (int)Math.Ceiling((metrics.Count + 0.0f) / (MAX_COLUMNS + 0.0f));
            this.note.text = gruopSize + (SettingsController.GetController().GetLanguage() == 0 ? " en " : " in ") + "1";

            for(int i = 0; i < Math.Ceiling((metrics.Count + 0.0f) / (gruopSize + 0.0f)); i++)
            {
                List<GameMetrics> currentGroup = metrics.GetRange(i * gruopSize, (i * gruopSize + gruopSize) <= metrics.Count ? gruopSize : metrics.Count - metricsPoints.Count * gruopSize);
                GameMetrics currentMetric = new GameMetrics(currentGroup[0].GetArea(), currentGroup[0].GetIndex(), currentGroup[0].GetLevel());
                currentMetric.SetDate(currentGroup[0].GetDate());
                for(int j = 0; j < currentGroup.Count; j++)
                {
                    currentMetric.SetScore(currentMetric.GetScore() + currentGroup[j].GetScore());
                    currentMetric.SetLapsedSeconds(currentMetric.GetLapsedSeconds() + currentGroup[j].GetLapsedSeconds());
                    currentMetric.SetRightAnswers(currentMetric.GetRightAnswers() + currentGroup[j].GetRightAnswers());
                    currentMetric.SetWrongAnswers(currentMetric.GetWrongAnswers() + currentGroup[j].GetWrongAnswers());
                }
                currentMetric.SetScore(Average(currentMetric.GetScore(), currentGroup.Count));
                currentMetric.SetLapsedSeconds(Average(currentMetric.GetLapsedSeconds(), currentGroup.Count));
                currentMetric.SetRightAnswers(Average(currentMetric.GetRightAnswers(), currentGroup.Count));
                currentMetric.SetWrongAnswers(Average(currentMetric.GetWrongAnswers(), currentGroup.Count));

                metricsPoints.Add(currentMetric);
            }
        }