using System.Collections.Generic; using Core.Runtime; using UnityEngine; namespace Goals.Runtime { public class GoalSystem : BaseMonobehaviour { #region Publics List AllGoals { get; set; } = new List(); #endregion #region Unity API // #endregion #region Main Methods public void AddGoal(Goal goal) { SetFact(goal.Id, goal, FactPersistence.Persistent); AllGoals.Add(goal); } public void EvaluateGoals(FactDictionnary goalsFacts) { // } public List GetGoalsByState(GoalState state) { return AllGoals != null ? AllGoals.FindAll(goal => goal.State == state) : new List(); } public bool AreAllGoalsCompleted() { return AllGoals != null && AllGoals.TrueForAll(goal => goal.State == GoalState.Completed); } #endregion #region Utils /* Fonctions privées utiles */ #endregion #region Privates and Protected // Variables privées #endregion } }