using System; using System.Collections; using UnityEngine; /// /// Satellite minigame — auto-completes after 1 second. /// Students can replace this with real gameplay via a PR. /// public class SatelitTask : MonoBehaviour, ITask { public string TaskID { get; set; } public TaskType TaskType { get; set; } public string TaskName { get; set; } public (double, double) TaskLocation { get; set; } public bool IsCompleted { get; private set; } private Action _onCompleted; private Action _onExit; public void Initialize(Action onCompleted) { IsCompleted = false; _onCompleted = onCompleted; StartCoroutine(AutoComplete()); } public void Complete() { if (IsCompleted) return; IsCompleted = true; _onCompleted?.Invoke(this); ExitTask(_onExit); } public void ExitTask(Action onExit) { onExit?.Invoke(this); } private IEnumerator AutoComplete() { Debug.Log("[SatelitTask] Satellite task started — auto-completing in 1s."); yield return new WaitForSeconds(1f); Complete(); } }