using UnityEngine;
using DataImport;

public class GameData : MonoBehaviour {

    private static ContentFile _content;
    public Activity CurrentActivity;

    private void Awake()
    {
        if (_content == null)
            LoadContent();

        CurrentActivity = _content.GetNextActivity();
        //CurrentActivity = _content.GetLongestActivityByType(ActivityType.AvB);
        //CurrentActivity = _content.GetLongestActivityByType(ActivityType.Break);
        //CurrentActivity = _content.GetLongestActivityByType(ActivityType.BasicMath);
        //CurrentActivity = _content.GetLongestActivityByType(ActivityType.FeatsOfStrength);
        //CurrentActivity = _content.GetLongestActivityByType(ActivityType.Trivia);
    }

    private void LoadContent()
    {
        TextAsset json = Resources.Load<TextAsset>("Gogopo_Content");
        _content = JsonImport.Import<ContentFile>(json.text);
    }

    public bool HasFollowupText()
    {
        return !string.IsNullOrEmpty(CurrentActivity.followup);
    }
}
