using System.Collections.Generic;
using UnityEngine;
///
/// Keep track of all courses
///
[CreateAssetMenu(menuName = "Create new Scriptable/CourseList")]
public class CourseList : ScriptableObject
{
///
/// Index of the active/to be loaded/current course
///
public int currentCourseIndex = 0;
///
/// List of all installed courses
///
public List courses = new List();
///
/// Get a course by CourseIndex
///
/// CourseIndex of the course, each unique course has a unique CourseIndex
/// Course associated with this index, null if no course was found
public Course GetCourseByIndex(CourseIndex courseIndex)
{
return courses.Find((c) => c.index == courseIndex);
}
///
/// Function to find a minigame-index in the list based on its index
///
///
public void SetCurrentCourse(CourseIndex index)
{
this.currentCourseIndex = courses.FindIndex((mi) => mi.index == index);
}
}