Sprint 6
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// Shared abstract class for the minigameControllers
|
||||
/// </summary>
|
||||
@@ -69,7 +70,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
// Prepare the signPredictor
|
||||
signPredictor.SetModel(signPredictorTheme.modelIndex);
|
||||
signPredictor.SwapScreen(webcamScreen);
|
||||
signPredictor.SetSignsList(GetSignsList());
|
||||
AddSelfAsListener();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
// This part is the only reason that feedbackProgress is needed in the abstract
|
||||
else if (feedbackProgress != null)
|
||||
{
|
||||
|
||||
feedbackProgress.value = 0.0f;
|
||||
}
|
||||
|
||||
@@ -115,6 +114,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
score.time = DateTime.Now.ToString();
|
||||
|
||||
// Save the new score
|
||||
user = UserList.GetCurrentUser();
|
||||
var progress = user.GetMinigameProgress(minigame.index);
|
||||
|
||||
// Get the current list of scores
|
||||
@@ -129,11 +129,12 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
highestScores.Sort((a, b) => b.scoreValue.CompareTo(a.scoreValue));
|
||||
|
||||
// Only save the top 10 scores, so this list doesn't keep growing endlessly
|
||||
progress.latestScores = latestScores.Take(10).ToList();
|
||||
progress.latestScores = latestScores.TakeLast(10).ToList();
|
||||
progress.highestScores = highestScores.Take(10).ToList();
|
||||
|
||||
PersistentDataController.GetInstance().Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The function that activates when the game ends, handles some endgame logic and displays the EndPanel
|
||||
/// </summary>
|
||||
@@ -152,7 +153,7 @@ public abstract class AbstractMinigameController : AbstractFeedback
|
||||
/// </summary>
|
||||
/// <param name="accuracy">The accuracy of the passed sign</param>
|
||||
/// <param name="predictedSign">The name of the passed sign</param>
|
||||
protected abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
|
||||
public abstract void ProcessMostProbableSign(float accuracy, string predictedSign);
|
||||
|
||||
/// <summary>
|
||||
/// Each minigame has their own way of calculating their score
|
||||
|
||||
Reference in New Issue
Block a user