Пример #1
0
 public void UpdateAchievementsOnQueue()
 {
     foreach (AchievementOnQueue achievement in control.achievementsOnQueue)
     {
         //PYScoreData.SetAchievements (achievement.name, achievement.achievements);
         PYScoreData.RegisterStudent(achievement.name, achievement.achievements, achievement.turmaIndex);
     }
     control.achievementsOnQueue.Clear();
 }
Пример #2
0
 public void UpdateScoresOnQueue()
 {
     foreach (ScoreOnQueue score in control.scoresOnQueue)
     {
         //PYScoreData.SetScore (score.name, score.score, score.difficultyLevel);
         PYScoreData.RegisterStudentByDifficulty(score.name, score.score, score.difficultyLevel, score.turmaIndex);
         //UpdateDifficultyScores (score.difficultyLevel);
     }
     control.scoresOnQueue.Clear();
 }
Пример #3
0
 /*
  * public static void UpdateDifficultyScores(int difficulty){
  *      if (difficulty == 3 || difficulty == 4 || difficulty == 5 || difficulty == 6) {
  *              int totalScoreDifficulty = 0;
  *              for (int i = 3; i <= 6; i++) {
  *                      if(PYScoreData.GetStudentByName (i, control.playerName) != null){
  *                              totalScoreDifficulty += PYScoreData.GetStudentByName (i, control.playerName).Score;
  *                      }
  *              }
  *              PYScoreData.SetScore (control.playerName, totalScoreDifficulty, 0);
  *      }
  *      if (difficulty == 7 || difficulty == 8 || difficulty == 9 || difficulty == 10) {
  *              int totalScoreDifficulty = 0;
  *              for (int i = 7; i <= 10; i++) {
  *                      if(PYScoreData.GetStudentByName (i, control.playerName) != null){
  *                              totalScoreDifficulty += PYScoreData.GetStudentByName (i, control.playerName).Score;
  *                      }
  *              }
  *              PYScoreData.SetScore (control.playerName, totalScoreDifficulty, 1);
  *      }
  *      if (difficulty == 11 || difficulty == 12 || difficulty == 13 || difficulty == 14) {
  *              int totalScoreDifficulty = 0;
  *              for (int i = 11; i <= 14; i++) {
  *                      if(PYScoreData.GetStudentByName (i, control.playerName) != null){
  *                              totalScoreDifficulty += PYScoreData.GetStudentByName (i, control.playerName).Score;
  *                      }
  *              }
  *              PYScoreData.SetScore (control.playerName, totalScoreDifficulty, 2);
  *      }
  * }
  */
 public static int GetPointsOnDifficulty(int playerIndex, int difficulty)
 {
     if (PYScoreData.GetStudentByName(control.playerName[playerIndex]) != null)
     {
         return(PYScoreData.GetStudentByName(control.playerName[playerIndex]).Score[difficulty]);
     }
     else
     {
         return(0);
     }
 }
Пример #4
0
    void Start()
    {
        if (control == this)
        {
            PYScoreData.Initialize();
        }

        /*
         * isPlayerActive [0] = true;
         * isPlayerActive [1] = true;
         */
    }
Пример #5
0
 public static string[] getAchievementsFromData(int playerIndex)
 {
     if (PYScoreData.GetStudentByName(control.playerName[playerIndex]) != null)
     {
         control.achievements[playerIndex] = PYScoreData.GetStudentByName(control.playerName[playerIndex]).Achievements;
     }
     else
     {
         control.achievements[playerIndex] = "";
     }
     return(control.achievements[playerIndex].Split(';'));
 }
Пример #6
0
 public static void UpdateScore(int playerIndex)
 {
     if (control.playerName [playerIndex] != "" && control.playerName [playerIndex] != "Anônimo")
     {
         if (!control.startedScore)
         {
             control.scoresOnQueue.Add(new ScoreOnQueue(control.playerName [playerIndex], control.score [playerIndex], control.difficultyLevel [playerIndex], control.turmaIndex [playerIndex]));
         }
         else
         {
             //PYScoreData.SetScore (control.playerName[playerIndex], control.score[playerIndex], control.difficultyLevel[playerIndex]);
             PYScoreData.RegisterStudentByDifficulty(control.playerName [playerIndex], control.score [playerIndex], control.difficultyLevel [playerIndex], control.turmaIndex [playerIndex]);
             //UpdateDifficultyScores (control.difficultyLevel);
         }
     }
 }
Пример #7
0
 public static void UpdateAchievements(int playerIndex)
 {
     if (control.playerName [playerIndex] != "" && control.playerName [playerIndex] != "Anônimo")
     {
         if (!control.startedScore)
         {
             control.achievementsOnQueue.Add(new AchievementOnQueue(control.playerName [playerIndex], control.achievements [playerIndex], control.turmaIndex [playerIndex]));
         }
         else
         {
             foreach (string achievement in PlaytableApiContainer.getAchievementsActual(playerIndex))
             {
                 //PYScoreData.SetAchievements (control.playerName[playerIndex], achievement);
                 PYScoreData.RegisterStudent(control.playerName [playerIndex], achievement, control.turmaIndex [playerIndex]);
             }
         }
     }
 }
Пример #8
0
 void Start()
 {
     PYScoreData.DeleteAll();
 }