Wes xx build fix

This commit is contained in:
Dries Van Schuylenbergh
2023-03-09 12:44:11 +00:00
committed by Louis Adriaens
parent 601cf38c61
commit 2fa54620ef
74 changed files with 1009 additions and 214 deletions

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using UnityEngine;
[Serializable]
public class User
{
[Header("Personal data")]
// User nickname
public string username;
// User avatar
public Sprite avatar;
[Header("Personal settings")]
// TODO: set personal settings and preferences
[Header("Progress")]
// Total playtime
public double playtime;
[SerializeField]
// List of courses a user started/completed
public List<Progress> courses = new List<Progress>();
[SerializeField]
// List of minigames a user played
public List<Progress> minigames = new List<Progress>();
// Get a list of all recently started courses, returns a list of tuples of `<CourseIndex idx, float courseProgress>`
public List<Tuple<CourseIndex, float>> GetRecentCourses()
{
// TODO: return better results (for now only return all courses)
List<Tuple<CourseIndex, float>> recentCourses = new List<Tuple<CourseIndex, float>>();
foreach (Progress courseProgress in courses)
{
CourseIndex idx = courseProgress.Get<CourseIndex>("courseIndex");
float progress = courseProgress.Get<float>("courseProgress");
recentCourses.Add(Tuple.Create<CourseIndex, float>(idx, progress));
}
return recentCourses;
}
// Get a list of all recommended courses, returns a list of tuples of `<CourseIndex idx, float courseProgress>`
public List<Tuple<CourseIndex, float>> GetRecommendedCourses()
{
List<Tuple<CourseIndex, float>> recommenedCourses = new List<Tuple<CourseIndex, float>>();
if (courses.Count == 0)
{
recommenedCourses.Add(Tuple.Create<CourseIndex, float>(CourseIndex.FINGERSPELLING, 0.0f));
}
else
{
// TODO: return better results (for now only return all courses)
foreach (Progress courseProgress in courses)
{
CourseIndex idx = courseProgress.Get<CourseIndex>("courseIndex");
float progress = courseProgress.Get<float>("courseProgress");
recommenedCourses.Add(Tuple.Create<CourseIndex, float>(idx, progress));
}
}
return recommenedCourses;
}
}